Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
dynamically assign id to body tag
Old 02-21-2009, 02:19 AM dynamically assign id to body tag
ericson3000's Avatar
Experienced Talker

Posts: 40
Name: Bob Davis
Location: Los Angeles, CA
Trades: 0
Anyone know how I can assign an ID to a body tag on a page from a link on another page? Could I use javascript?
ericson3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-21-2009, 08:19 AM Re: dynamically assign id to body tag
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Meaning if someone follows a certain link, an ID is put on the body? Sure, just put a query string on the href of the link. You could put this directly under your opening body tag:
HTML Code:
<body>
<script type="text/javascript">
if(window.location.search == "?id=true")
     document.getElementsByTagName("body")[0].id = "my-dynamic-id";
</script>
Then, the link would have to read: <a href="my-page.htm?id=true">some text</a>
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 02-23-2009, 09:45 AM Re: dynamically assign id to body tag
virgil's Avatar
Average Talker

Posts: 29
Name: virgilio quilario jr
Trades: 0
can you explain more why you wanna do this? there might be other good solutions.
__________________
Your thoughts matter!

Please login or register to view this content. Registration is FREE
|

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
virgil is offline
Reply With Quote
View Public Profile Visit virgil's homepage!
 
Reply     « Reply to dynamically assign id to body tag
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18910 seconds with 12 queries