html - jQuery Select array not working -


html code:

<select name="code[]">     <option value="1">1</option>     <option value="2">2</option>     <option value="3">3</option> </select> <select name="code[]">     <option value="1">1</option>     <option value="2">2</option>     <option value="3">3</option> </select> <select name="code[]">     <option value="1">1</option>     <option value="2">2</option>     <option value="3">3</option> </select> 

jquery code:

var codes = $("input[name='code[]']").serializearray(); alert(codes); 

alert empty why happening selected value in select box. still, empty can please me. how can resolve error?

the selector trying find inputs.. should change select.

var codes = $("select[name='code[]']").serializearray(); 

https://jsfiddle.net/3qdbkx36/


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -