Advertisements
Advertisements
प्रश्न
Write about <script> tag.
थोडक्यात उत्तर
उत्तर
JavaScript can be implemented using <script>… </script> tags. The <script> tag containing JavaScript can be placed anywhere within in the web page, but it is normally recommended that should be kept it within the <head> tags. The <script> tag alerts the browser program to start interpreting all the text between these tags as script commands.
The syntax of a JavaScript segment in Hyper Text Markup Language (HTML) or Dynamic Hyper Text Markup Language (DHTML) is as follows:
<script language=”javascript” type=”text/
javascript”>
JavaScript code
</script>
The <SCRIPT> tag takes two important attributes:
- Language- This attribute specifies the scripting language. Typically, its value will be javascript.
- Although recent versions of HTML (Extensible HyperText Markup Language – XHTML, its successor) have phased out the use of this attribute is optional.
- Type – This attribute is used to indicate the scripting language and its value should be set to “text/javascript”.
shaalaa.com
Using Javascript in HTML Page
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?