javascript - Add class to radio button -


<input id="radio1" type="radio" name="rgroup" value="1" >  <label for="radio1"><span><span></span></span>1</label> <input id="radio2" type="radio" name="rgroup" value="2" >  <label for="radio2"><span><span></span></span>1</label> 

i have , want add image element checked using javascript. how can it?

is important add class radio checked? can css:

#radio1:checked + label {     color: #f00; } 

demo

#radio1:checked + label:after {     content: url(image_url_here); } 

demo 2 (with image embedded when select radio box)

demo 3 (with tick image)


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -