admin管理员组文章数量:1427140
I have an input text field like below
<input type="checkbox" value="9961103777" name="mobile[]">
I just want to get the value using jquery. I tried this but not working:
jQuery('input[name=mobile[]]');
Please help me in this.
I have an input text field like below
<input type="checkbox" value="9961103777" name="mobile[]">
I just want to get the value using jquery. I tried this but not working:
jQuery('input[name=mobile[]]');
Please help me in this.
Share Improve this question edited Feb 20, 2014 at 8:07 Chen-Tsu Lin 23.3k16 gold badges56 silver badges65 bronze badges asked Feb 20, 2014 at 7:52 akhil n lakhil n l 1812 silver badges10 bronze badges4 Answers
Reset to default 3You can use val() as well as wrapping the name of your input inside double quotes " "
:
jQuery('input[name="mobile[]"]').val()
Put attribute value in quotes. To fetch its value use .val()
jQuery('input[name="mobile[]"]')
DEMO
try
$("input[name='mobile[]']").val();
try this ..
Refer this post Jquery get input array field
$('input[name^="mobile"]').each(function() {
alert($(this).val());
});
JS Fiddle Example
本文标签: javascriptGetting value of text field with array type name using jQueryStack Overflow
版权声明:本文标题:javascript - Getting value of text field with array type name using jQuery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745489883a2660556.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论