Click here to Skip to main content
13,089,818 members (47,028 online)
Rate this:
Please Sign up or sign in to vote.
Hi all
My Code
var dataTable = "<ol>";
$.each(, function (key, value) {
                            dataTable += '<li ><a href="' + + '"  önmousedown=javascript:StoreClickedURL(' + userId + ',"' + encodeURI(userInput) + '","' + + '")>' + + '</a></li>';
 dataTable += "</ol>";

I am dynamically creating anchors.Here house down event is working fine in all browser except IE.

I searched in Google but not found any appropriate solution for this.

Please help me.

Thanks in advance
Posted 8-Nov-12 18:38pm
Updated 8-Nov-12 19:23pm
You misuse jQuery. Its style is adding event handler when document is ready. Writing JavaScript event handler is HTML elements is totally redundant thing, and error-prone.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You are going in wrong direction — please see my comment to the question.

This is a jQuery pattern of doing things:
   someElement = $("#someId"); // assuming some element has id="someId"
   // generate HTML or not, does not matter
       // so something

Please see:[^],[^],[^],[^].


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100