I am not getting 11

0 MAYANK JINDAL · May 3, 2015
code -- <!Doctype HTML>
<html>
    <head>

    </head>
    <body>
           <script type="text/javascript">
                  var x= "mayank";
                  var y =24;
                  document.write(x + " jindal" +  age);
                  function may(x){
                  alert("i" + "<br />"+ " love" + x);
                  }
                  function add(b,c){
                  var a = b + c ;
                  return a;
                  }
           </script>
           <form>
           <input type="submit" value ="click me " onclick = 'may("mayank")'>
           </form>
           document.write(add(5,6));
    </body>
</html>

Post a Reply

Replies

Oldest  Newest  Rating
0 zhang yida · May 3, 2015
oh,dear,you put this sentence in  a wrong place:     document.write(add(5,6));
0 MAYANK JINDAL · May 3, 2015
where should I put this ??
0 Tincu Andrei · May 3, 2015
put document.write(add(5,6)); in a script tag
  • 1

Javascript

107,277 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators