Hi all,

I'm having a small issue with generated content using prototype's
Element object. Here's the gist of what i'm doing

var para = new Element('p',
{'class':'button',onclick:'alert("hello");'}).update("Alert You?");

after i just insert this into a div on my page. When i go to the page
i do get the text "Alert You?" but the onclick only works in firefox.
I get nothing out of IE not even an error.

It seems to work if i do this: var para = '<p class="button"
onclick="alert(\'Alert You?\');">Alert You?</p>';
then i insert the p into my container div.

I know doing event handlers like this is bad, bad, and frowned upon,
but even if i do it unobtrusively it still doesn't work in IE6 or 7.

Any help would be much appreciated.


John

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to