Webmaster Forum Rules | Posting Guide | Contact Us | Testimonials | Contributing Geek Program | Advertise on Geek/Talk
Welcome to the GeekTalk Webmaster Discussion Forums from GeekVillage.com

Click Here To Register. It's Free!

Go Back   geek/talk: Signature-free discourse for serious web publishers > YOUR CREATION: Building & Maintaining A Web Site > Web Development - Programming / Coding
User Name
Password
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 08-23-2005, 08:20 PM   #1
aredamkrik
Registered User
 
Join Date: Aug 2005
Posts: 15
Default getAttribute() question

I want to use this line to save my original background and be able to go back to it.

origBackground = document.getElementById(elm).style.getAttribute("b ackground");

// elm= 'body' (id of the <body> element)

This works if you set the attribute b4 the line using

document.getElementById(elm).style.setAttribute("b ackground","BLACK");

or

document.getElementById(elm).style.background="BLA CK";


I am wondering if there's a different way to get the attributes from my CSS?

I have it linked and the background comes up right, but it cannot be retrieved in javascript by getAttribute()

the function is called like this

<body id="body" onLoad="saveStyle('body')">
<a href="#" onClick="restoreStyle('body');">Original</a>
<a href="#" onClick="changeStyle('body','style1');">Style 1</a>
</body>
aredamkrik is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADMIN: VIP geek/chat transcripts for 5/20/00. READ ME! Steve_S Archives of old posts from Let's Barter/Trade, Buy, & Sell 0 05-21-2000 12:12 PM
ADMIN: VIP geek/chat transcripts for 5/20/00. READ ME! Steve_S Marketing Your Website Online 0 05-21-2000 12:11 PM
ADMIN: VIP geek/chat transcripts for 5/20/00. READ ME! Steve_S Making Money with CPC and/or CPM Programs 0 05-21-2000 12:09 PM
ADMIN: VIP geek/chat transcripts for 5/20/00. READ ME! Steve_S Web Design and Webmaster Issues 0 05-21-2000 12:08 PM
Perplexing Tax Question KidKilowatt Making Money with CPC and/or CPM Programs 11 03-30-2000 09:11 PM

Please support our advertisers. They ensure our survival.

All times are GMT -5. The time now is 11:57 PM.


GeekVillage.com is copyright © 1998-2015 Curiosity Cave - Science gifts for clever kids. All rights reserved.
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.