Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Replace Div

DZone's Guide to

Replace Div

·
Free Resource
Found at http://www.vivabit.co.uk/
function clickArea(tagName, className) { 
var els = document.getElementsByTagName(tagName); 
for (var i = 0; i < els.length; i++) if (els[i].className.indexOf(className)>=0) { 
els[i].onmouseover=function() {this.className+=" soopahover"} 
els[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" soopahover\\b"), "")} 
els[i].onclick = function () {location.href = this.getElementsByTagName("a")[0].href} 
} 
} 

window.onload = function() { 
clickArea("div", "soopalink"); 
}
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}