...

View Full Version : Setting body id?



lilqhgal
07-18-2007, 07:29 PM
Is there a small javascript snippet or something that can dynamically set the body ID on page load? I am using the Inverted Sliding Doors tabs from 456 Berea Street (http://www.456bereastreet.com/lab/inverted_tabs/) but am trying to do so in a frameset [insert angry comments here] (I know I know, please don't harp!)... anyway, the tabs css sets the active tab using the body ID, but I can't seem to get it to recognize the body ID inside the frameset. Is there a javascript or some other code I could use to dynamically set the body ID? Or perhaps a better approach? Thanks.

rnd me
07-19-2007, 03:34 AM
<script>
document.getElementsByTagName("body")[0].id="exampleID1"
</script>

felgall
07-19-2007, 10:14 AM
Why do you need to give the body an id when document.getElementsByTagName("body")[0] is a unique reference to it without needing an id? You only need to give ids to tags where there can be more than one and you need to identify a specific one.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum