Introduction to Javascript


javascript Introduction to Javascript JavaScript Introduction

JavaScript Full Easy and Short Course

JavaScript is a scripting language and it is the language that is use with html page. It is use for following purposes: - For displaying static information or content. - For displaying dynamic information or content. - Displaying timely content updates. - Maps , 2D and 3D graphics. - Interacting with external APIs. (E.g Google TV Chrome-cast). We will discuss the JavaScript from basic to advanced in chapter sequence. Here we are going to discuss the on-click button event . When we will click on the below button the content will load into the html tag "<div>" .

Source Code for " Click me " button: <div id="mydiv"></div> <button onclick="myfunction()">Click me</button> <script type="text/javascript"> function myfunction() { document.getElementById('mydiv').innerHTML = 'I am the content, loaded by button onclick.'; } </script> The function with name " myfunction() " loaded when button will click. We have called the " myfunction() " on-click. document.getElementById('mydiv').innerHTML="I am the content, loaded by button onclick."; We have a div with id=''mydiv'' , in JavaScript code, we have wrote the code that mydiv will load with desired content "I am the content, loaded by button onclick" . Lets continue the JavaScript in the next chapter .

javascript JavaScript Introduction Chapter Next »