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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745489883a4629940.html
评论列表(0条)