Navbar

Friday 21 June 2019

JavaScript Introduction - Tech Talk Tricks

JavaScript Introduction
                                                                                                           Back to JavaScript Home
JavaScript is client side dynamic pages technology.It is object based scripting language and cross platform.As we know JS is not a compiled language, it is translated language.

Application of JS :

You can use JS for create interactive web pages.It is mainly used for : 
  1. For client side validation.
  2. For create dynamic drop down.
  3. For displaying Date and Time

Example of JavaScript : 
                  <script type="text/javascript">  
                       document.write("Hello from Tech Talk Tricks"); 
                </script>


Explanation of above example : 
        <script> : If you want to use java script then use <script> tag in your HTML document. 
        type="text/javascript : The text/javascript is the content type that provides information                                                to the browser about the data.
       document.write() : this function used to print dynamic content through JS.

You can use JavaScript in these places of HTML document :
  1. Between the body HTML tag 
  2. Between the head HTML tag
  3. In external .js file.


Javascript code in body tag :
  You can use javascript code in body tag of html as follows : 
     <html>  

        <body>  
           <script type="text/javascript">  
              alert("Hello Tech Talk Tricks");  
           </script>  
        </body>  
     </html>  

Javascript code in head tag :

  1. <html>  
  2.      <head>  
  3.           <script type="text/javascript">  
  4.               function welcome(){  
  5.                  alert("Hello TechTalkTricks");  
  6.           }  
  7.          </script>  
  8.      </head>  
  9. <body>  
  10.       <p>Welcome to Tech Talk Tricks</p>  
  11.       <form>  
  12.          <input type="button" value="click" onclick="welcome()"/>  
  13.       </form>  
  14. </body>  
  15. </html>  

Watch Full Video on YouTube : 



No comments:

Post a Comment

Share your views after read this post