How To Hide And Show A Div From A Button On Cmenu Yii Framework

I would like to show/hide a Div in my page, whenever I click on a button ON MY CMenu. I tried so many solutions and nothing works for me. I am still a beginner in Yii :(

Please tell me the best way to do this in yii.

this my div that I want to show and hide


<div  id="myContent">  balabalabala </div>

and this is my Item in my Cmenu:


<?php $this->widget('zii.widgets.CMenu',array(

                'htmlOptions'=>array('class'=>'nav'),

                'submenuHtmlOptions'=>array('class'=>'dropdown-menu'),

                'itemCssClass'=>'item-test',

                'encodeLabel'=>false,

                'items'=>array(


array('label'=>'Rechercher <img src="'.Yii::app()->theme->baseUrl.'/img/icons/ic_action_search.png" style="margin-top: -8px;"  />','url'=>('#')),

I found this solution but for a link not a CMenu Item


 Yii::app()->clientScript->registerScript('showGenre', ""."$('css_genre_class').click(function(){".

                                "$('#myContent').toggle();".

                                "});".

                                "");

How can I integrate it in my Cmenu !!

appreciate any help

You need to add array(‘onClick’=>’…’) to the specific item ‘htmlOptions’=>array() to call the toggle()

P.s google is your friend:

yii cmenu jquery function

The link is broken!!

It worked when posted but not no…Sorry :(