Possible Duplicate:
How to get a value of an element by name instead of ID
How can I read the value of the field named item[tags][] from the following HTML document:
<ul id="mytags" class="tagit">
<li class="tagit-choice">
Acrylic
<input type="hidden" name="item[tags][]" value="Acrylic" style="display: none;">
</li>
<li class="tagit-choice">
Bath
<input type="hidden" name="item[tags][]" value="Bath" style="display: none;">
</li>
</ul>
You don’t have to use brackets to pass values as an array since
nameis not required to be unique across the page. Values with the samenameattribute are passed on form submit as an array automatically.I created an example filling JS array with elements values.
Markup:
Code
You can play with it: http://jsfiddle.net/VAjeN/