Programming Tags

The programming tags are used to write client side program.

 

  • <script> - The <script> tag is used to write client-side JavaScript code. JS code are defined whithin the <script></script> tag. Also link the external script file throug the  src attribute.
    • USAGE:-
      • <script>
        document.getElementById("demo").innerHTML = "Hello JavaScript!";
        </script>
      • <script src="/js/hello.js"></script> - External File linked here.
  • <noscript> - The <noscript> tag is used to define an alternate content for browsers where scripts are disabled or does not support scripts.
    • Note:- In HTML 4.01 The <noscript> tag is used only within <body> tag. But in HTML5 it can used within both <head> and <body> tag. In XHTML not support the <noscript> tag.
    • USAGE:-
      • <!DOCTYPE html>
        <html>
        <head>
        <title>NOSCRIPT TAG</title>
        </head>
        <body>
        <script>
        document.write("Hello World!")
        </script>
        <noscript>Your browser does not support JavaScript!</noscript>
        <p>A browser without support for JavaScript will show the text inside the noscript element.</p>
        </body>
        </html>
  • <applet> - The <applet> tag is used to define an embedded applet. Applet is a java program for web.
    • NOTE:- HTML5 does not support <applet>.
    • USAGE:-
      • <html>
           <title>The Hello, World Applet</title>
           <hr>
           <applet code = "HelloWorldApplet.class" width = "360" height = "200">
             
        If your browser was Java-enabled, a "Hello, World"
              message would appear here.
           </applet>
           <hr>
        </html>
  • <embed> - The <embed> tag is used as container for an external application or interactive content, like flash animation. It is new in HTML5 but not supported in HTML 4.
    • USAGE:-
      • <!DOCTYPE html>
        <html>
        <body>
          <embed src="helloworld.swf">
        </body>
        </html>
  • <object> - The <object> tag is used to embet object within HTML document. This element can use to embed multimedia files like audio, video, java applets, ActiveX, PDF, and flash in web page.
    • USaGE:-
      • <!DOCTYPE html>
        <html>
        <body>
            <object width="400" height="400" data="objectExmaple.swf"></object>
         </body>
        </html>
  • <param> - The <param> tag is used to set parameters for object or plugin embedded with an <object> tag.
    • USAGE:-
      • <!DOCTYPE html>
        <html>
        <body>
        <object data="Hello.wav">
            <param name="autoplay" value="true">
        </object>
        </body>
        </html>

More you may like to read