-
Multiple IDs in getElementByIDs
Hey i am new to javascript and trying to modify this
<script type="text/javascript">
document.onclick=check;
function check(e){
var target = (e && e.target) || (event && event.srcElement);
var obj = document.getElementById('content');
checkParent(target)?obj.style.display='none':null;
}
function checkParent(t){
while(t.parentNode){
if(t==document.getElementById('content')){
return false
}
t=t.parentNode
}
return true
}
</script>
basically i have two divs with different ids i need to have this functionality on both the divs. when i am putting the script for a single div its works fine. my question is how can i have the functionality with two different divs having two different ids.
please help
thanks in advance
-
-
Please only post one thread, posting more then one will not get anymore attention.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks