jQuery check prop. of Radio and uncheck onClick

drill

New Member
So here is the code\[code\]<html> <head> <link href="http://stackoverflow.com/fuctions/style.css" rel="stylesheet" media="screen" type="text/css" /> <script type="text/javascript" charset="utf-8" src="http://stackoverflow.com/fuctions/cordova-2.3.0.js"></script> <script type="text/javascript" charset="utf-8" src="http://stackoverflow.com/fuctions/functions.js"></script> <script type="text/javascript" charset="utf-8" src="http://stackoverflow.com/fuctions/jq.js"></script> </head> <body> <div id="topbar"> <div id="title"><!--Title--> After Landing </div> <div id="leftnav"> <a href="http://stackoverflow.com/index_aerosoft.html">Home</a> <a href="http://stackoverflow.com/questions/14545214/katana_checklist_all.html">Overview</a><!--AllChecklist--> </div> <div id="rightnav"> <a href="http://stackoverflow.com/questions/14545214/katan_checklist_engineshut-downl.html"id="a_next">Next</a></div><!--NextPage--> </div> <div id="content"> <ul class="pageitem"> <li class="radiobutton" onClick="checkChanges()"> <span class="name">Wing Flaps -<font color="red"> UP </font></span> <input name="1" type="radio" value="http://stackoverflow.com/questions/14545214/other" /> </li><!--CheckpunktEnd--> <li class="radiobutton" onClick="checkChanges()"> <span class="name">Carburetor Heat -<font color="red"> OFF </font></span> <input name="2" type="radio" value="http://stackoverflow.com/questions/14545214/other" /> </li><!--CheckpunktEnd--> <li class="radiobutton" onClick="checkChanges()"> <span class="name">Exterior Lights -<font color="red"> as required </font></span> <input name="3" type="radio" value="http://stackoverflow.com/questions/14545214/other" /> </li><!--CheckpunktEnd--> <li class="radiobutton" onClick="checkChanges()"> <span class="name">Electric Fuel Pump -<font color="red"> OFF </font></span> <input name="4" type="radio" value="http://stackoverflow.com/questions/14545214/other" /> </li><!--CheckpunktEnd--> </ul> </div> <div id="footer"> <a class="noeffect" href="http://stackoverflow.com/questions/14545214/#" onClick="resetChecklist();">Reset Checklist</a><!--ResetChecklist--> <br /><br /> <a class="noeffect" href="http://stackoverflow.com/questions/14545214/#" onClick="openxyzDE();">xyz</a> </div> </body></html>\[/code\]And i got a function that check for "radio is checked and change colour"\[code\]function checkChanges(){ $('.radiobutton font').attr('color', 'red'); $('.radiobutton :checked').closest('.radiobutton').find('font').attr('color', 'green');}$(function() { checkChanges(); $('.radiobutton :radio').on('click', checkChanges); });\[/code\]I want to add to that code a function that uncheck the Radio if its checked and been clicked again (onClick) this should also change the colour back to red.
 
Back
Top