<p id="p1">
Текст1
</p>
<button onclick="fn1()">
1 вариант
</button>
<button onclick="fn2()">
2 вариант
</button>
<button onclick="fn3()">
3 вариант
</button>
<button onclick="fn4()">
4 вариант
</button>
<button onclick="fn5()">
5 вариант
</button>
let p1 = document.getElementById("p1")
let fn1 = () => p1.textContent = "Текст1";
let fn2 = () => p1.textContent = "Текст2";
let fn3 = () => p1.textContent = "Текст3";
let fn4 = () => p1.textContent = "Текст4";
let fn5 = () => p1.textContent = "Текст5";
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.