jquery - Getting a specific field by name? -
i have form number of fields, each same name:
<input type="text" name="title[]" placeholder="title" value="a">
how can specific field?
i have tried:
console.log($('input[name=title[]]').val());
but no luck.
as @adrift mentions, need wrap name attributes in quotes because has special character's. once done can use eq()
enter index value of element specific input element-
console.log( $('input[name="title[]"]').eq(3).val() );
Comments
Post a Comment