Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery select by input 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?

like image 361
carloscc Avatar asked Jan 21 '13 17:01

carloscc


1 Answers

Use:

$('input[name="price"]').change(function() {

Check out the jQuery selectors docs for more info.

like image 123
Tom Walters Avatar answered Sep 21 '22 12:09

Tom Walters