Help - Search - Members - Calendar
Full Version: Menu item
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
asu
Hi all,
I created menu and sub menu items also.
i am able to call onclick() function on click of menu item. but when i call onclick() function on submenu item i am getting error as syntax error.

i am giving a sample coding:

For menu i gave:
<UL>
<li><a href = '#'onclick="alert('test');">test</a></li>
</UL>



For submenu i gave as:
<a href="#" onMouseover="showmenu(event,linkset[0])" onMouseout="delayhidemenu()">Billing</a><br>
linkset[0]='<a href="" onclick="alert('test');">test</a></li>'
.
.
.
.


please what to do urgent need.
thanks blink.gif

Christian J
QUOTE(asu @ Jul 24 2009, 12:04 PM) *

linkset[0]='<a href="" onclick="alert('test');">test</a></li>'

You nest two sets of single quotes, one around the linkset[0] string and one in the alert('test'). Try escaping the second set with backslashes:

CODE
alert(\'test\');
asu
QUOTE(Christian J @ Jul 24 2009, 05:43 AM) *

QUOTE(asu @ Jul 24 2009, 12:04 PM) *

linkset[0]='<a href="" onclick="alert('test');">test</a></li>'

You nest two sets of single quotes, one around the linkset[0] string and one in the alert('test'). Try escaping the second set with backslashes:

CODE
alert(\'test\');




Thank you very much Christian. i want actually this only.

Is it right to give button click event as
linkset[0]='<a href="" onclick="document.getElementById(\'pb83\').click();" >Menu Link</a>'

thankyou
bye
asu
Once again thank you Christian J. I forget to put # symbol.
i am getting now.
i am new to this.

Regards
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.