I know there are loads of questions similar to this, but I can't find the answer I'm looking for among them.
Probably super simple: I have a very basic JS function, and it has a single argument passed to it. I just want the function to recognise that argument when used in the document.getElementById as the ID.
HTML
<div id="figure1" onmouseover="popup(figure1)"><div class="hide"> TEST </div></div>
JS Function
<script>
function popup(fig) {
var setnow = document.getElementById( fig );
setnow.className = "show";
}
</script>
I have tested it without using the argument, i.e.:
<script>
function popup() {
var setnow = document.getElementById("figure1");
setnow.className = "show";
}
</script>
... and it works as expected.
I don't use JS ever, so probably this is very simple. :-)