Answers for "chrome onclick not working"

0

html onclick not working

Note to other developers coming across this, you can run into this if you use a reserved method names e.g. clear.
<!DOCTYPE html>
<html>
<body>
  <button onclick="clear()">Clear</button>
  <button onclick="clear2()">Clear2</button>
  <script>
  function clear() {
    alert('clear');
  }
  function clear2() {
    alert('clear2');
  }
  </script>
</body>
</html>
Posted by: Guest on May-18-2021
0

chrome extension onclick not working

window.onclick = function(event) {
		var target = event.target;
		console.log(target.matches);
		//console.log(event);
        if (target.matches('.clickableBtn')) {
         alert('Called Classsname clickableBtn');
        }
		if (target.matches('#qidirish')){
			alert('Called identifer qidirish');
		}
}
Posted by: Guest on June-20-2021

Code answers related to "chrome onclick not working"

Browse Popular Code Answers by Language