I'm doing this page with a lot of image links that change when the mouse hovers above them. I have a function for changing the image here:
function hoverImg(element) {
if (element.src.indexOf("_hover.png") == -1) {
element.src = element.src.replace(".png","_hover.png");
} else {
element.src = element.src.replace("_hover.png",".png");
}
}
However, I have to give "this" as a parameter for the function on each onmouseover and onmouseout event for each element. Is there a way to just know what element called a function? Function copying isn't an option because, as I said, there'll possibly be a good hundred of these small images per page and the pages will be eventually generated from database data anyway. Adding "this" each time seems highly redundant...