QrDroid



Sharecodepoint popular queries

Sunday, 24 December 2017

JavaScript Tutorial : Flexibility of using JavaScript anywhere in a HTML document. - JavaScript Part 2


Flexibility of using JavaScript anywhere in a HTML document.
1→ script in head section.
2→ script in body section.
3→ script in both head and body sections.

JavaScript Introduction Part 1 : Checkout

Example 1 :
<html> 
 <head> 
     <script> 
         document.write("this is inside head"); 
     </script> 
  <body> 
  </body> 
 </head> 
</html>
Output :
this is inside head

Example 2 :
 <html> 
 <head>
  <body>
    <script> 
         document.write("this is inside body"); 
    </script> 
   </body> 
  </head> 
</html>
Output :
this is inside body

Example 3 :
<html> 
 <head> 
  <script> 
    document.write("this is inside head"); 
  </script> 
 </head>
 <body> 
  <script> 
     document.write("this is inside body"); 
  </script> 
 </body>
</html>
Output :
this is inside head
this is inside body

JavaScript Introduction Part 1 : Checkout
About Developer
Konakalla Premsai
I love to make things simple :)

0 comments:

Post a Comment

 

Version 20.2.1 - 2016 - 2018 - © Sharecodepoint | Made in India. | Copyright Content