Monkuar Posted August 28, 2012 Share Posted August 28, 2012 I want to make a event listener so I don't have to use onhover="xxxx" and put it on each html tag. let's say I have <div id='postactions' style='display:none'> hey </div> Now, instead of putting a onhover=function() on each tag, how can I make it so javascript will do that onhover function for all ID's that are postactions? Quote Link to comment https://forums.phpfreaks.com/topic/267684-event-listener-help-please/ Share on other sites More sharing options...
squigs Posted August 28, 2012 Share Posted August 28, 2012 could you not wrap it all in a div with one id that triggers the onhover? Quote Link to comment https://forums.phpfreaks.com/topic/267684-event-listener-help-please/#findComment-1373145 Share on other sites More sharing options...
Christian F. Posted August 28, 2012 Share Posted August 28, 2012 jQuery can help you solve this problem quite nicely. Quote Link to comment https://forums.phpfreaks.com/topic/267684-event-listener-help-please/#findComment-1373296 Share on other sites More sharing options...
codefossa Posted August 28, 2012 Share Posted August 28, 2012 jQuery can help you solve this problem quite nicely. Not .each() but .hover() Quote Link to comment https://forums.phpfreaks.com/topic/267684-event-listener-help-please/#findComment-1373298 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.