Search
 
SCRIPT & CODE EXAMPLE
 

HTML

include html file in html file

// js
<script>
$(function () {
  var includes = $('[data-include]')
  $.each(includes, function () {
    var file = $(this).data('include')
    $(this).load(file)
  })
})
</script>
// html
<div data-include="header.html"></div>
<div data-include="footer.html"></div>
Comment

html include html page

// js
<script>
$(function () {
  var includes = $('[data-include]')
  $.each(includes, function () {
    var file = $(this).data('include')
    $(this).load(file)
  })
})
</script>
// html
<div data-include="header.html"></div>
<div data-include="footer.html"></div>

https://www.w3schools.com/howto/howto_html_include.asp
Comment

PREVIOUS NEXT
Code Example
Html :: how to formate text in div 
Html :: use png instead of icon html 
Html :: how to remove fieldset border in html 
Html :: svg rounded corners 
Html :: how to fix navbar in bootstrap 
Html :: html a link to section on page 
Html :: add svg to html 
Html :: bootstrap range input 
Html :: button float right 
Html :: placeholder wpf 
Html :: html make a table with two top headers 
Html :: html button link 
Html :: font awesome css content not working 
Html :: button accessible name html 
Html :: box search bootstrap 
Html :: how to make a draggable menu html/js jquery 
Html :: set an image half its original size css 
Html :: fav icon 
Html :: call javascript function from a tag 
Html :: meta tag tester 
Html :: how to escape in html 
Html :: how to make anchor tag open in new tab 
Html :: hide first option in select 
Html :: tailwind resize none 
Html :: angular add html attribute on condition 
Html :: svg img tag not showing 
Html :: whats app chat link for html 
Html :: comment a div in html 
Html :: class required bootstrap 3 
Html :: html img src background 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =