web hosting and development forums
Web Design and Development Forums Archive


Index - JavaScript forum

onclick event


Post reply

Hello. I have a list of news. And till now the layout was solved with tables. Each news was in a table row and had 3 extra events... onmouseover, onmouseout and onclick I solved onmouse over and onmouse out with css and htc behaviours For ie. Now, how can I solve the onclick event? I would like to optimize the code as much as possible.
It sounds like your question is "I'm doing something (but I won't tell you what) with JavaScript onclick, and now I want to do it another way. How can I do that?". If that is the question, then we really don't have enough information to make any suggestions.
So instead of puttin onmouseclick=somefunction() to each DIV I'd like to make a function that will append this functio automaticall7y to all DIVs in let say <DIV id="news"> autos06, do you get what I'd like? is not what you suggested
Var divs = document.getElementById('news').getElementsByTagName('div'); for (var i = divs.length; i; i--) { divs[i].onclick = somefunction; } I guess.
Nice Somenthing like this, ye :D But something like this I have to call onPageLoad, right?
Onload, yes.
Thanks alot for helping me out




Dubai Forum | Paris Forum | Webmaster Forum | Vegan Forum | Brisbane Forum | 3D Forum | Jobs in Dubai | Jobs in London | London UK Classifieds
Archive script by RedHo.com