Include html file in html using client side language

I have a file index.html which I want to separate the header and footer in header.html and footer.html and include them in index.html. How can I do this?

I have searched in google. They said I can do it using javascript. But I can’t able to make a working solution. Please help.


The best and cleanest approach would be to do this with a server-side language. Is there a reason why you can’t do that?

Every server supports server-side language? I mean I am new in server knowledge. Can you please explain. Thanks

What about Node.js as server?

I’d say keep it simple. Most hosts support PHP, and PHP makes this extremely easy. Here is a simple way to do it.