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
1 day 14 min ago
1 day 5 hours ago
1 day 9 hours ago
1 day 11 hours ago
2 days 1 hour ago
2 days 1 hour ago
2 days 6 hours ago
2 days 13 hours ago
2 days 14 hours ago
2 days 15 hours ago