I am trying to create an expand on click feature on my website. When the user clicks on the button, something is displayed.
I know I can use JS to make the div show up, but my HTML code is long, so I don't want to copy the entire thing there. I know I can also use the tag, but I don't want my page to refresh.
function findPressure() {
var ifrm = document.createElement("iframe");
ifrm.setAttribute("src","/Users/lunapark/Documents/antoine_equation/antoine_pressure.html");
document.body.appendChild(ifrm);
}
<div class="col-md-9">
<button onClick="findPressure()">Solve for Pressure</button>
<button onClick="findTemp()">Solve for Temperature</button>
</div>
As you can see here, I used iframe, which I am not in favor of. Is there some way I can link the existing HTML to my main HTML and not have it refresh on a web page?