I have a function that goes like
Code:
function collapse(div) {
var currentdiv = document.getElementById(div);
currentdiv.style.zIndex = 3;
}
and code from the html document calls that function like
Code:
<a onclick="collapse('pictures')">pictures</a>
where pictures is the name of a <div> later on that had the id of pictures. Anyway, how can I tell Javascript that I'm passing a string so that the document.getELementById part will work? For example, the code will work if I write in document.getElementById("pictures");.
Recent comments
4 hours 1 min ago
10 hours 42 min ago
14 hours 33 min ago
16 hours 11 min ago
1 day 37 min ago
1 day 10 hours ago
1 day 10 hours ago
1 day 14 hours ago
1 day 18 hours ago
1 day 19 hours ago