JavaScript in HTML

Which tag do we use insert a JavaScript in HTML page?

Questions by anilyashsoni

Showing Answers 1 - 1 of 1 Answers

sonam2907

  • Mar 5th, 2011
 

Please note that there is no such tag to embed javascript in HTML.
JavaScript is entirely client side scripting language and used inside <script> tag.
That does not mean that javascript is just another tag in HTML.. It is totally different language used for client side validation mainly.

  Was this answer useful?  Yes

Wasim Rulez

  • Apr 28th, 2011
 

we can do it like this

<html>
<head>
<title>Some title of your choice</title>
<script="JavaScript"></script>
</head>
<body>
</body>
</html>

this is the proper way of inserting JavaScript into html

  Was this answer useful?  Yes

Nisa

  • Oct 9th, 2011
 

Having type property value is javascript so following code will be used for putting javascript in HTML

Code
  1. <script type="text/javascript">

  2. </script>

  Was this answer useful?  Yes

Mahendar

  • Dec 30th, 2011
 

We use < script > tag to indicate javascript in html.

Place this inside < head > tag.

Example:

Code
  1.  

  2. <script type="text/javascript">

  3.  

  4. function xyz()

  5. {

  6. /// your code

  7. }

  8. </script>

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions