Quick Search
Sunbelthost Hosting - Colocation and Dedicated Servers

Threads: 21,763
Posts: 83,205
Members: 24,315
Newest member: joemccue

Web Hosting


 
  #1  
Old 13 Nov 2009, 12:28 PM
NewTechGuy NewTechGuy is offline
Newbie
 
Join Date: Nov 2009
Posts: 3
style.backgroundColor returning empty string

PHP Code:
echo "<div id='d1' onclick=\"alert(this.style.backgroundColor)\" width='100%'>content</div>"
This line of code is working but for some reason it is returning an empty string. I have set the css background color of the div in internal(not inline) css above the div. What am I missing here?

Thanks,
NewTechGuy
Reply With Quote
  #2  
Old 15 Nov 2009, 12:57 PM
usedearplugs usedearplugs is offline
Established Member
 
Join Date: Oct 2009
Posts: 53
Thumbs up

At first I thought you needed to use background-color, but I was wrong. If you use inline styles, your command will work, but it's not grabbing it from the stylesheet. I've had that problem before. Doing some more research.
Reply With Quote
Reply

Thread Tools

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
encrypt and decrypt query string vannova Client & Server Side Scripting (PHP, ASP, JavaScript) 0 05 Jun 2007 06:59 AM
eval() if the string isn't 100% PHP code? compuXP Client & Server Side Scripting (PHP, ASP, JavaScript) 0 18 Jul 2005 04:37 PM


All times are GMT -5. The time now is 01:24 PM.


 

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Forums Copyright © 2004-2010, WebDevForums.com. Web design by Miami Web Design. All Rights Reserved.