How to use JavaScript Statement

In this article I am going to explain about JavaScript statement.
  • 1988

JavaScript Statement

An statement defined what will do and how it will be done. Such as changing a variable value, coiling a function, assigning a new value to variable, adding a semicolon at end of every code etc. The statement command to browse for what to do and how it will be do. Unlike Html JavaScript is an Case Sensitive programming language.  so it is very necessary different between capital and small at time of writing JavaScript code The statement are common to all programming language. Every programming language follow own statement so JavaScript also follow own statement. The statement are following.

  • Condition Statement
  • Loop Statement
  • Comment statement
  • Exception handling statement
  • Object manipulation statement.
  • Group statement

In this example we will manipulate with function statement.

<html>

<body>

    <p id="test">

        Hello</p>

    <button type="button" onclick="myFun()">

        Click me</button>

    <script type="text/javascript">

        function myFun() {

            document.getElementById("test").innerHTML = "Hello Friends";

 

        }

</script>

</body>

</html>

 

Output


 statement.jpg

Further Readings

You may also want to read these related articles: here

Ask Your Question 

 Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.