Covert unorderd list with checkboxes to dropdown with checkboxes
Hello, I have an ul that contains checkboxes and I would like to have it converted to a dropdown with checkboxes and labels using Jquery or JavaScript.
How can this be accomplished if my ul looks like this?
Hey Pawel.
Thanks for your help! I looked at your examples and then found this: http://jsfiddle.net/mTSLa/222/
which is closer to what I want to do but it does not work in IE.
What do you think?
Paweł
nice, i moved that same fiddle into codepen and it works in ie
It is pretty cool and does work on codepen, just not in my app for some reason. When I click on the dropdown it does not open. When I inspect the dropdown it and the controls within are created correctly. I am using the latest JavaScript and Jquery.
It is crazy. I added everything exactly as it is on codepen. The dropdown is created but when you click on it id does nothing in all browsers. Originally I thought is was my razor which is generating the <ul> but I replaced that with the list from codepen and still a no go. There are no JavaScript errors. Must be something higher in my app from another script file or something.
Thanks for your help! I looked at your examples and then found this: http://jsfiddle.net/mTSLa/222/
which is closer to what I want to do but it does not work in IE.
What do you think?