Try to use html,.load()
HTML
// e.g., "/path/to/html/"
<div id="first">Hello World 1 <h1 class="page-title">H1 Heading HTML tag</h1> <p>Para Tag</p></div>
<div class="second">Hello World 2 <h1 class="page-title">H1 Heading HTML tag</h1> <p>Para Tag</p></div>
<img src="image-1">
<img src="image-2">
Js
$("#container1").load("/path/to/html/ #first");
$("#container2").load("/path/to/html/ .second");
$("#container3").load("/path/to/html/ [src=image-1]");
$("#container4").load("/path/to/html/ img:eq(1)");
source
share