0

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.

4 Answers 4

3

You can use val() as well as wrapping the name of your input inside double quotes " ":

jQuery('input[name="mobile[]"]').val()
Sign up to request clarification or add additional context in comments.

1 Comment

You need to wrap the name in " "
1

Put attribute value in quotes. To fetch its value use .val()

jQuery('input[name="mobile[]"]')

DEMO

Comments

1

try

$("input[name='mobile[]']").val();

1 Comment

This is the one I was looking for, worked great!
0

try this ..

Refer this post Jquery get input array field

$('input[name^="mobile"]').each(function() {
    alert($(this).val());
});

JS Fiddle Example

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.