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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -