Search
 
SCRIPT & CODE EXAMPLE
 

HTML

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>
Comment

PREVIOUS NEXT
Code Example
Html :: jumbotron bootstrap 5 
Html :: javascript display with fade 
Html :: html-search-bar 
Html :: form row twig symfony 
Html :: what is defer in html 
Html :: class html 
Html :: how to set all to left on html 
Html :: script attach in html 
Html :: div search bar 
Html :: html input attributes 
Html :: html <input 
Html :: html.beginform with form id 
Html :: Custom Form 
Html :: html images @2x 
Html :: render html view react native 
Html :: search button inside search box 
Html :: html code heavy right arrow 
Html :: lang element html 
Html :: androif intent in html link 
Html :: custom radio css 
Html :: shopify random number 
Html :: remark asp markup 
Html :: aligment absolute center slds 
Html :: br tag deprecated 
Html :: onclick reportrange html 
Html :: html form generator 
Html :: ubuntu 22.10 vmware 
Html :: what is cold crypto wallet 
Html :: tailwind box with text 
Html :: Horizontal line with text in middle word in HTML 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =