JQuery OnClick Função
$( "#other" ).click(function() {
$( "#target" ).click();
});
Evil Elephant
$( "#other" ).click(function() {
$( "#target" ).click();
});
const element = document.querySelector('element');
element.click();
// Create variable for what you are trying to click
let button = document.querySelector("#IDofItem");
// Click the button
if (button) {
button.click();
}
else {
console.log("Error");
}
window.onload = function() {
var userImage = document.getElementById('imageOtherUser');
var hangoutButton = document.getElementById("hangoutButtonId");
userImage.onclick = function() {
hangoutButton.click(); // this will trigger the click event
};
};
<element onclick="functionToExecute()">Click</element>
document.addEventListener('click', function(e) {
e = e || window.event;
var target = e.target || e.srcElement,
text = target.textContent || target.innerText;
}, false);