Html template | Sololearn: Learn to code for FREE!

+1

Html template

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

web

8/25/2020 4:18:52 AM

Mohamed

6 Answers

New Answer

+3

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

+2

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.

+2

"The <template> tag is used as a container to hold some HTML content hidden from the user when the page loads." source W3schools https://www.w3schools.com/tags/tag_template.asp HTML Tag Reference https://www.w3schools.com/tags/default.asp

+1

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

0

No! My question is, how to display TEMPLATES?

0

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