I have included the jquery-steps plugin.
How can I change the buttons texts?
Now it says "finish" I want to change that into "go"
Thanks
Answer: Use the jQuery prop() and html() Methods You can simply use the jQuery prop() method to change the text of the buttons built using the HTML <input> element, whereas to change the text of the buttons which are created using the <button> element you can use the html() method.
- GeeksforGeeks How to change an HTML element name using jQuery ? Given an HTML document and the task is to replace an HTML element by another element. For example: we can change an element <b> with <h1> element without changing any other property. Select the HTML element which need to be change.
Given an HTML document and the task is to replace an HTML element by another element. For example: we can change an element <b> with <h1> element without changing any other property. Select the HTML element which need to be change. Copy all attributes of previous element in an object.
The :button selector selects button elements, and input elements with type=button. Tip: Using input:button as a selector will not select the button element.
Check out the following link. You can change all labels on initialization.
var settings = {
labels: {
current: "current step:",
pagination: "Pagination",
finish: "Finish",
next: "Next",
previous: "Previous",
loading: "Loading ..."
}
};
$("#wizard").steps(settings);`
I just needed to change button text depending on condition. And it can be done without changing settings just like that
if(true){
$('a[href$="finish"]').text('Go');
}else{
$('a[href$="finish"]').text('No Go');
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With