I have this input:
<tr><td class="forms">Price:</td><td><input type="text" name="price" size="30"/></td></tr>
How can I call this input?
Example: With this code I call to the id:
$("#numberclasses").change(function() {
And I call to the class with this:
$(".numberclasses").change(function() {
But How can I call to the name?
I have this input:
<tr><td class="forms">Price:</td><td><input type="text" name="price" size="30"/></td></tr>
How can I call this input?
Example: With this code I call to the id:
$("#numberclasses").change(function() {
And I call to the class with this:
$(".numberclasses").change(function() {
But How can I call to the name?
Share Improve this question edited Jan 21, 2013 at 17:38 Shomz 37.7k4 gold badges60 silver badges87 bronze badges asked Jan 21, 2013 at 17:36 carloscccarloscc 7994 gold badges16 silver badges21 bronze badges 3- what is numberclasses here? – Ravi Y Commented Jan 21, 2013 at 17:37
- 2 @ryadavilli does it matter? – Shomz Commented Jan 21, 2013 at 17:39
- 1 possible duplicate of How can I select an element by name with JQuery? – John Koerner Commented Jan 22, 2013 at 0:15
1 Answer
Reset to default 17Use:
$('input[name="price"]').change(function() {
Check out the jQuery selectors docs for more info.