How to append onclick event to li class?
I want to apply this attribute:

	onclick=​"expandMenu(this.parentNode)​"

to every li with the class="parent"

So far I have this and can't get it to work:


	<script type="text/javascript">
	if ($('li').hasClass('parent'))
	{
	'onclick' => 'expandMenu(this.parentNode)';
	}
	</script>

How to append onclick event to li class?
===

I want to apply this attribute:

	onclick=​"expandMenu(this.parentNode)​"

to every li with the class="parent"

So far I have this and can't get it to work:


	<script type="text/javascript">
	if ($('li').hasClass('parent'))
	{
	'onclick' => 'expandMenu(this.parentNode)';
	}
	</script>
