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

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -