0

I was planning to construct an HTML file which takes the input from another file.

Example

I want write an HTML file as follows:

<html>
.
.
//file content
.
</html>

File as follows:

<td> </td>
.
.

Is there a simple way to do this?

Community
  • 1
  • 1
E V N Raja
  • 110
  • 1
  • 5
  • 17
  • Possible duplicate of [Include another HTML file in a HTML file](https://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file) – Steve Mulvihill Jun 30 '18 at 04:11

1 Answers1

1

You can do it using the jQuery .load() function, but it is better to use another container rather than the HTML element tag. A div for example:

<div id="container">

</div>

And your JavaScript code using jQuery:

$('#container').load('path/to/your/file.html');
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Facundo Larrosa
  • 3,349
  • 2
  • 14
  • 22