So here is the jQuery snippet I am using to create a div that I want to click on
$("#someID").after('<div style="cursor:pointer; text-decoration:underline; display:inline;" onClick="alert(\'It Worked\');">Details</div>');
This Works in FireFox without any problems its just IE that doesn’t fire the event. The div is added right after #someID but the onclick doesn’t work.
You should add the click handler using jQuery’s
clickmethod, like this:This will work, and will also be much faster. (The browser won’t need to fire up a Javascript parser)