Script: 

  1. <html>
  2. <head>
  3. <title>JavaScript</title>
  4. </head>
  5. <body>
  6. <Script Language=”JavaScript”>
  7. var x=17;
  8. var y=12;
  9. var a=x+y
  10. write(a);
  11. </Script>
  12. </body>
  13. </html>

Explain of Script:

  • Line number 1 is a start is a html tag.
  • Line number 2 is a start is a head tag.
  • Line number 3 is a title tag. This page title is “JavaScript”.
  • Line number 4 is a close head tag.
  • Line number 5 start body tag.
  • Line number 6 start JavaScript tag.
  • Line number 7 is “var” type variable x=17.
  • Line number 8 is “var” type variable y=12.
  • Line number 9 is a “var” a=x+a
  • Line number 10 is a write.
  • Line number 11 is a closed JavaScript tag.
  • Line number 12 is a close body tag.
  • Line number 13 is a close html tag.

Script:

  1. <html>
  2. <head>
  3. <title>JavaScript</title>
  4. </head>
  5. <body>
  6. <Script Language=”JavaScript”>
  7. var x=50;
  8. x+=5
  9. write(x); “+=” addition assignment operator
  10. </Script>
  11. </body>
  12. </html>

Explain of Script:

  • Line number 1 is a start is a html tag.
  • Line number 2 is a start is a head tag.
  • Line number 3 is a title tag. This page title is “JavaScript”.
  • Line number 4 is a close head tag.
  • Line number 5 start body tag.
  • Line number 6 start JavaScript tag.
  • Line number 7 is “var” type variable x=50.
  • Line number 8 is used addition assignment operator x+=5
  • Line number 10 is x write.
  • Line number 11 is a closed JavaScript tag.
  • Line number 12 is a close body tag.
  • Line number 13 is a close html tag.

Leave a Reply

Your email address will not be published. Required fields are marked *