I've got a problem, i want to add "checked" when i click on the input but I don't know how to do, here is my jQuery code :
jQuery('#myId div input').click(function(){
jQuery(this).attr('checked', 'checked');
});
And this is my HTML code :
<form id="myId">
<div class="grid12-12">
<input type="radio" value="292" id="292" class="required-entry">
<label for="292">Ordonnance.jpg</label>
</div>
</form>
but the thing is that if I do that, this is what happens, I have this in my tag :
checked = "checked"
And I want only "checked" in my tag like this
<input type="radio" id="292" value="292" checked>
if I remove the checked in the jQuery like this :
jQuery('#myId div input').click(function(){
jQuery(this).attr('', 'checked');
});
I have an error.
So how can I do that please ? Thanks in advance :)