I'm writing a function which requires knowing the location of the clicked div.
I'm wondering if I can get the location of a clicked object as a javascript variable?
here is the code.
HTML
<area shape="rect" coords="103, 0, 213, 25" href="#" onClick="swap3($(this),'product-details','product-specs');">
Javascript:
function swap3(currentDivId ,oldDivId, newDivId) {
var oldDiv = currentDivId.nextAll("div." + oldDivId);
var newDiv = currentDivId.nextAll("div." + newDivId);
oldDiv.style.display = "none";
newDiv.style.display = "block";
}