does anyone know how to make a button in HTML load another HTML page inside of an iframe?
I don't understand online tutorials for this, and here's what I tried :
<div class="flex-container"> <!-- la sidebar et le iframe seront dedans -->
<div class="sidebar">
<button style="margin-top: 100px;" onclick="Function1">Thés</button>
<button>Tisanes</button>
<button>Théières</button>
</div>
<!--FUNCTION1-->
<script>
function Function1() {
document.getElementById(src="accueil.html").innerHTML = src="Thés.html" TARGET="iframe";
}
</script>
<iframe src="accueil.html" frameborder="0" style="border: none; width: inherit; height: 710px; id="iframe">
</iframe>
</div>
</body>
</html>
Is this even how it's supposed to be done? Cause nothing is happening when the button Thés is clicked. I'm quite new and I'm bad with javascript. Thanks if anyone has the patience to explain this to me.