Wednesday, January 28, 2015

call or invoke onclick event function by javascript

var elem = document.getElementById("image_id");
if (typeof elem.onclick == "function") {
elem.onclick.apply(elem);
}

No comments:

Post a Comment

Suomen kieli (Imperfekti)

In Finnish, the imperfekti is the past tense that describes actions that happened in the past, like the English simple past (e.g., "I ...