Tuesday, January 23, 2018

How to Write a program Function Parameters using a javascript.

We are using a parameters in function of javascript

<html>
   <head>
   
      <script type="text/javascript">
         function sayHello(name, age)
         {
            document.write (name + " is " + age + " years old.");
         }
      </script>
      
   </head>
   <body>
      <p>Click the following button to call the function</p>
      
      <form>
         <input type="button" onclick="sayHello('Zara', 7)" value="Say Hello">
      </form>
      
      <p>Use different parameters inside the function and then try...</p>
   </body>
</html>

Output





0 comments:

Post a Comment

Thanks For Commented.

TechTalk