The No Scripting Element
The Scripting Element
The HTML Template Element
The content of the <template> element is hidden on page load and actioned via scripting.
Creating A Webpage
Lets create a webpage for our scripting tags to see what they do!
- Open up your HTML editor or text editor, which in my case is Notepad++.
- Open a document if required.
- Copy and paste the following code into the document.
bodytag for efficiency --> <script src="http://htmldoctor.info/js/vendor/jquery-3.5.1.min.js"></script> </body> </html>
Saving the document
Save the file as
View Page in Web Browser
Either navigate to the location you saved the
scriptingtags.htmlfile to and double click the file. This will take you to the page in your default web browser, or from your web browser click File --> Open File and navigate to the file and open it.
After doing either of these you should see a similar webpage in your browser to the following screenshot:
The <template> tag is used for declaring fragments of HTML that can be cloned and inserted into the HTML document by a script. In our example every time the 'Let there be pie' button is pressed we display the contents of the <template> element via some scripting using the
Lesson 1 Complete
In the next lesson we take a final look at HTML structure when we look at page structure.
The <noscript> no script tag
The <script> script tag
The <template> template tag