Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery selecting elements by name

I have the following html:

<td valign="top" align="left"> <input style="width:250px;" name="men_url" type="text" /></td>


<td valign="top" align="left"> 
<select name="men_page">
 <option value="">Wybierz stronę</option>
 <option value="index.php?page=8">O firmie</option>
 <option value="index.php?page=9">Referencje</option>

</select>
</td>

and two corresponding jQuery selectors:

$("select[name='men_page']")

and

$("input[name='men_url']")

The first one works great, the second one returns nothing. What might be wrong here?

Especially alert($("input[name='men_url'").name); displays "undefined"

like image 244
kubal5003 Avatar asked Dec 16 '22 23:12

kubal5003


1 Answers

The 2nd one is missing the closing ]

like image 73
rosscj2533 Avatar answered Dec 27 '22 00:12

rosscj2533