How do I select a button with specific value with jQuery?
<input type="button" value="My task">
The value attribute specifies the initial value for a <button> in an HTML form. Note: In a form, the button and its value is only submitted if the button itself was used to submit the form.
The value property sets or returns the value of the value attribute of a button. The value attribute specifies the underlying value that is associated with a button. Important: If you use the <button> element in an HTML <form>, different browsers will submit different values.
Introduction to JavaScript getElementsByName() methodThe getElementsByName() accepts a name which is the value of the name attribute of elements and returns a live NodeList of elements. The return collection of elements is live.
You can use the attr=value
selector:
$('input[type="button"][value="My task"]')
example: http://jsfiddle.net/niklasvh/yAUkC/
Like:
$('input[type=button][value=My task]');
You want to select by attributes: jQuery page.
So it says: select input
s of type button
with value My task
.
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