I would like to create a button similar to these:
As of now, I've done the following:
=========================================================================
<button id = "button" onclick = "random_element()">click
here</button>
<h1 style = "color:pink;"> Project Title</h1>
<p id = "ZZZ" style = "font-size: 14px; color:
#a8bcff;"></p>
<script>
var zzz = document.getElementById('ZZZ');
var arr = ["aaa", "bbb", "ccc", "ddd"];
// how do we substitute these strings with HTML lists in arr?
function random_element() {
zzz.innerHTML = arr[Math.floor(Math.random() * arr.length)];
}
</script>
<ol id="list">
<li>video1 to be randomly chosen/displayed on button click </li>
<li>video2 to be randomly chosen/displayed on button click </li>
<li>video3 to be randomly chosen/displayed on button click </li>
<li>video4 to be randomly chosen/displayed on button click </li>
</ol>
=========================================================================
I understand how to generate random elements in the form of text. But I don't know how to make a JS array that contains all of the html lists of iframes.
What's the proper way to reference and USE html content between <li></li> tags inside a JavaScript array?