0
Can we refer one block of code of any html page to another html page
There is some piece of code which is in my home page and i need it in my all sub page. Is there any way ? that i can use any key or class instead of using this bulk code numerous time
4 Antworten
+ 1
You could try using the template tag, which is a specialc ag used to display some piece of html code which you dont want to show yet. The Browser will not render the elements inside the tag. You just your piece of code inside the tag and when you need it you clone the template's children with the Help of JavaScript and append it inside the body or wherever you want.
+ 1
Thanks Abdoul Hakim i will try this.
+ 1
I can use this tag in html5 or not Abdoul Hakim
+ 1
Yes the <template> tag is supported in HTML5