If you donβt like users who have JavaScript disabled or using some mobile platforms, you can use JavaScript to do this.
headerfooter.js
window.onload = function () { var header = document.getElementById('header'); var footer = document.getElementByID('footer'); header.innerHTML = "<h1>My website</h1><h2>Rules</h2>"; footer.innerHTML = "<small>This code is in the public domain</small>"; }
page.html
<html> <head> <script type="text/javascript" src="headerfooter.js"></script> </head> <body> <div id="header"></div> ... Your content ... <div id="footer"></div> </body> </html>
But do not do this, he is unfriendly and unprofessional. Just stick to either using php or creating a solid template that you don't need to edit much later.
source share