This issue is also related with Joomla, so I apologize in advance if this is not the correct place to ask.

I would like to create a link withing the main menu that contain javascript code, but when I try to apply the changes, joomla delete de content of the url inputbox... how do I have to write the code?

This is the code I try to put as a link in the menu. Ive a div in the content with id="greeting" and contains the text "hi". I want this "hi" to change to "hello" when clicking on the menu link..

<a href="#" onclick="Document.getElementById('greeting').innerHTML = 'hello';return false;">Change the greetings</a>
This link within the same content as where the div is, works perfectly. But I want it as a menu link..

Any idea?