i am using jquery inside theme customizer my requirement is to show a textarea by checking a checkbox.i am using
class Example_Customize_Textarea_Control extends WP_Customize_Control {
public $type = 'textarea';
public function render_content() {
?>
<label>
<span class="customize-control-title"><?php echo esc_html($this->label ); ?></span>
<input type="checkbox" name="c1"> </label>
<script>
jQuery(function($){
// alert();
$('#customize-control-textarea').hide();
$('#customize-control-checkbox').click(function(){
alert();
});
// hide control at first load
// bind to the event that will show the Control
});
</script>
<?php
}
}
when i click the checkbox alert is working fine.but the text area is not hidden.i want to show he textarea only the user click on the checkbox. instead of jquery(function($) i use document.ready but it doesn’t seems to be working .can anyone show me the right way of doing these