Script Element in HTML5.

1 comment

To define the client-side JavaScripts we use script<script> element.

It is basically offer authors a  mean to extend HTML documents in many active & interactive ways.

Example

<!DOCTYPE html>
<html>
<head>
<title>HTML script Tag</title>
</head>
<body>
<script type="text/javascript">

      document.write("hello!")

</script>

</body>
</html>


Attributes of script elements:

  • type: this attribute is used to specify what type of scripting language is used such as text/javascript.
  • src: this attribute is used to specify an external source of a script file
  • charset: this attribute is used to specify what type character set of the element
  • defer: this attribute is used to specify that the script doesn’t generate any type of document content for which browser doesn’t have to worry about it while the loading the page

Categories: Designs, Html, Main

One Comment

Leave A Comment

Loading...