I am trying to check the radio box onClick using jQuery, my code is below:
<ul class="icons clearfix">
<li>
<input type="radio" value="123456" name="selecticon"/>
<label for="select_icon">
<img src="pics/123456.jpg" alt="123456" width="34" height="34" />
</label>
</li>
<li>
<input type="radio" value="654321" name="selecticon" />
<label for="select_icon">
<img src="pics/654321.jpg" alt="654321" width="34" height="34" />
</label>
</li>
</ul>
and jQuery code...
//onclick select icon
$(document).ready(function(){
$('ul.icons li').click(function() {
$('ul.icons li.selected').removeClass('selected');
$(this).addClass('selected').children("input[@type=radio]").attr('checked');
});
});
But on click its not checking radio button, please suggest, thanks.