Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selection panel - javascript radio button groups

I'm looking for a way to modify a page like this> http://speckyboy.com/demo/digg-style-radio-buttons/index.html so users can highlight one selection per row, IOW 8 radio button groups using a comparable visual style, not the traditional looking radio button controls.

I've tried nearly all the suggestions in stackoverflow I could find for handling radio button groups the last few days, but I clearly don't know enough js to adapt those suggestions properly. Can anyone help?

like image 839
user1729539 Avatar asked Aug 25 '26 04:08

user1729539


1 Answers

You should use class(not ID, id must be unique on the page).

1 You can get all radio buttons

$('.class')

2 Now you can use each More details here http://api.jquery.com/each/

 $('.class').each(function(index) {
       // Add to element
    });

3 To add you can with

http://api.jquery.com/add/

http://api.jquery.com/appendTo/

http://api.jquery.com/append/

http://api.jquery.com/html/

like image 168
Anton Baksheiev Avatar answered Aug 27 '26 17:08

Anton Baksheiev