Answers for "how to give event to onclick method"

0

onclick on non button

var ele = document.getElementById('x');
if(typeof ele.click == 'function') {
  ele.click()
} else if(typeof ele.onclick == 'function') {
  ele.onclick()
}
Posted by: Guest on July-30-2020

Code answers related to "how to give event to onclick method"

Browse Popular Code Answers by Language