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

25th Apr 2020, 8:23 PM
NITESH KUMAR
NITESH KUMAR - avatar
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.
25th Apr 2020, 9:38 PM
Abdoul Hakim
Abdoul Hakim - avatar
+ 1
Thanks Abdoul Hakim i will try this.
26th Apr 2020, 6:34 AM
NITESH KUMAR
NITESH KUMAR - avatar
+ 1
I can use this tag in html5 or not Abdoul Hakim
26th Apr 2020, 6:40 AM
NITESH KUMAR
NITESH KUMAR - avatar
+ 1
Yes the <template> tag is supported in HTML5
26th Apr 2020, 8:38 AM
Abdoul Hakim
Abdoul Hakim - avatar