Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
JavaScript
var node = this.doc.createElement("span");
 node.setAttribute("id","123");
 node.setAttribute("title", "sample");
  node.addEventListener('mouseover', ev_onMouseOver, false); ----FF
node.attachEvent("onmouseover", ev_onMouseOver); ---- For IE < 9

I have used two ways to add eventhandler on Mouseover event, one for IE and other for FF
My question is : Does Jquery has some method or way so that i dont have to use two different way here.
I went through blogs which does tell about Jquery's 'bind' and 'on' method and also specific mouseover method but couldnt make a decision yet which one to use.
Also i am pretty new to JS, so i couldn't figure out exact syntax to write it in Jquery.
Posted

1 solution

Look at this, $.bind[^] there is also $.on[^] which is the preferred method.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900