Html template | Sololearn: Learn to code for FREE!


Html template

Hello guys, please I do have a question, how to display html template by using onclick button Function in javascript?


8/25/2020 4:18:52 AM


6 Answers

New Answer


html: <button id = "btn" onclick = "func">click</button> Js: function func() { alert("hello"); }


Mohamed, where did you get your definition of an html template from? A template, in computing, is a preset format for a document or file (according to the Oxford English dictionary). Showing and hiding different parts of a document is commonly done using JavaScript, this is how dropdown menus are handled. I can see from your profile that you have only just started the css and JavaScript courses but not the html course. The normal order is to learn html, css, then JavaScript. It's difficult to style html elements using css when you don't know what html elements are, and it's difficult to control the style of those elements using JavaScript if you don't understand css first.


"The <template> tag is used as a container to hold some HTML content hidden from the user when the page loads." source W3schools HTML Tag Reference


Html template: is something that it doesn't show in the browser until you press the button


No! My question is, how to display TEMPLATES?


Thanks, the problem is that I want to write everything in html