jquery - alert in javascript not showing -


<!doctype html> <html>  <head>     <script type="text/javascript">     if (document.getelementbyid("popup")) {         window.alert("hi");     }     </script> </head>  <body>     <h1 id="popup">dfdfs</h1> </body>  </html> 

i have simple javascript shows alert when h1 id exits ,but not getting alert message.code in jquery can help.

put <script> tag @ end of body:

<!doctype html> <html>  <head> </head>  <body>     <h1 id="popup">dfdfs</h1>     <script type="text/javascript">     if (document.getelementbyid("popup")) {         window.alert("hi");     }     </script> </body>  </html> 

Comments

Popular posts from this blog

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World