I'm a nOOb to javascript. I'm just starting, and can't figure out why my script gives an error.
I've made a function that shows a div and hides a variable number of other divs.
This is the function:
I address the function at the following way:
Bu this doesn't seem to work... Can anyone tell me why? I've searched several sites, tried several solutions, but none worked.
Thanks in advance
---------------
Visit Stray Cats Fan!! Go Cat!! Go!!
I've made a function that shows a div and hides a variable number of other divs.
This is the function:
Code:
function showdiv(show, hide) {
// show div
var obj= document.getElementById(show);
obj.style.visibility = "visible";
//hide div
arr = hide.split(",");
var aantal = arr.length;
for(i = 0; i < aantal; i++) {
document.getElementById(arr[i]).style.visibility = "hidden";
}
}
I address the function at the following way:
Code:
<a href="javascript: void(0)" onClick="javascript: showdiv('divtoshow', 'divtohide1, divtohide2');">Link</a>
Bu this doesn't seem to work... Can anyone tell me why? I've searched several sites, tried several solutions, but none worked.
Thanks in advance
---------------
Visit Stray Cats Fan!! Go Cat!! Go!!