javascript - Clickable list item that select a radio -
I have this html ... when I click on the Li item, I want the radio input to toggle Know that you can wrap the whole thing in a label but I can not change the HTML (JS and CSS only).
Any thoughts?
& lt; Li & gt; & Lt; Input type = "radio" name = "KETELWIZARD_TYPE_WONING" data-label = "app" value = "Appartement | Appartement" & gt; Appartement & lt; Span class = "image" & gt; & Lt; Img src = "https://acceptatie.foursites.nl/feenstra-ketelkiezer/wp-content/uploads/appartement.png" height = "24" width = "23" alt = "" & gt; & Lt; / Span & gt; & Lt; / li & gt;
If you want to click anywhere on the screen to check the radio : <(": Radio"). Prop ('check', true);});
If you want to toggle it (I think you might want to):
$ ("li "). (Function () (var $ radio = $ (this). Find (": radio") $ radio.prop ('checked',! $ Radio.prop ('checked'));});
Comments
Post a Comment