Wednesday 14 May 2014

Javascript Syntax

The syntax of javascript is simple as like html.Only you have to start with the <script> tag and close with </script>tag.

For Example-

<script>

//(Javascript codes come in between this)

</script>


The script tag takes two important attributes:


language: This attribute specifies what scripting language you are using. Typically, its value will be javascript. Although recent versions of HTML (and XHTML, its successor) have phased out the use of this attribute.

Type: This attribute is what is now recommended to indicate the scripting language in use and its value should be set to "text/javascript".

So your JavaScript segment will look like:

<script language="javascript" type="text/javascript">
  JavaScript code
</script>


Note-By using the above code you can start your own code ...In my next post i ll teach you the first program with the help of javascript ...if you like then comment your views hoping best revert from your side. Thanks
:-)

No comments:

Post a Comment