I have several input elements which look like this:
<input type="radio" checked="checked" value="1" name="handle[123]" />
<input type="radio" checked="checked" value="2" name="handle[456]" />
The number inside the name attribute is an object id i need. Now what I want to do is:
- Fetch all input which are of type=”radio” and are checked with prototype
- Put all ids and values in an associative array
…so the resulting array looks something like this:
array{ 1 => 123, 2 => 456 }
Any ideas?
Here’s what I came up with:
Demo