[eluser]Juan Velandia[/eluser]
Hello Everyone, I'm starting with Jquery and I'm trying to hide a div when a user checks a radio button, and as this is my first jquery code within Codeigniter I'm having some issues:
this is in the view
Code:
<div class="div_to_hide">
This must be hidden!
</div>
this is the javascript in <head>
Code:
$(document).ready(function() {
$("#person").click(function(){
$('div.div_to_hide').hide();
alert("HELLO this works!");
});
And heres the radio button with the form helper format
Code:
<? $js1 = 'onClick="$('div.hide').hide();"'; ?>
Persona:<?php echo form_radio('#person', 'Natural', TRUE, $js1 ); ?>
Any Ideas?. Thanks a lot, Any suggestion will be highly appreciatted.