How can I create a dynamic array in an array with dynamic keys and dynamic values using javascript?
For an example, check below what I’d like:
Studentslist
Student Info 1
"name" => "varun",
"age" => "24"
Student Info 2
"name" => "Kumar",
"age" => "25"
Add More Info About This Question
I have a radio buttone like this
<input type="radio" value="student1" id="student1" name="student1group1"/>
<input type="radio" value="student2" id="student1" name="student1group1"/>
<input type="radio" value="student3" id="student2" name="student1group2"/>
<input type="radio" value="student4" id="student2" name="student1group2"/>
I need to setup a array in array when any radio button is clicked for eg in student1group1 any of the 2 radio buttons is clicked i need to get the array like below
Studentslist
Student Info 1
"name" => clicked value of the radio button,
You can try this
for getting student detail you can try.
with radio buttons, you can try
javascript :
You can call this method to alert.