JS

GET HTML CONTENT WITH FETCH

(quick guide & examples)

TO PUT THE LOADED CONTENTS <div id="demo"></div>

RUN DEMO <input type="button" value="Load" onclick="load()">

DUMMY HTML FORM

01

function load () {   FETCH DUMMY.HTML   fetch("dummy.html")

JAVASCRIPT FETCH

02

  RETURN RESULT AS TEXT   .then(res => {     if (res.status != 200)     { throw new Error("Bad Response"); }     return res.text();   })

  PUT CONTENT INTO <DIV>   .then(html =>      document.getElementById     ("demo").innerHTML = html   ); }