I have this HTML:
<div class="myclass" id="myid">
Trying to use the following to search for the element with this ID inside this class:
var getDiv = document.getElementById("myid").getElementsByClassName("myclass")[0];
getDiv.setAttribute("style", "visibility: hidden");
This returns getDiv
as 'undefined'
I will have numerous elements with the same class or ID, but only one element exists on the page with both.