I am trying to make a script that sets a class for the label of a checkbox when i click it once and when i click it again it reverts to the first class.
This is the code i have:
    <label for="img1">
    <img class="img1" src="Images/testimg.jpg" onclick="javascript:test()" id="t1" />
    </label>
    <input type="checkbox" class="chk " id="img1" name="img1" value="1" />
I want the test function to assign the class img2 when it is called and when i call it again to assign the class img1.
 
     
     
     
     
    