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ę</opt开发者_运维技巧ion>
<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"
The 2nd one is missing the closing ]
also, there's no "name" property. Use $(..).attr('name')
instead.
// Pozdrawiam ;) / ["greetings", in polish] ;)
it should be
$("input[name='men_url']")
精彩评论