javascript click button by id
var button = document.getElementById("button");
button.click();
javascript click button by id
var button = document.getElementById("button");
button.click();
get element by click
document.addEventListener('click', function(e) {
e = e || window.event;
var target = e.target || e.srcElement,
text = target.textContent || target.innerText;
}, false);
get element by click
window.onclick = e => {
console.log(e.target.innerText);
}
get element by click
window.onclick = e => {
console.log(e.target); // to get the element
console.log(e.target.tagName); // to get the element tag name alone
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us