Quick Search

Threads: 26,130
Posts: 108,041
Members: 19,510
Newest member: sharvesh

Web Hosting


 
  #1  
Old 13 Nov 2009, 01: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, 01: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 08:59 AM
eval() if the string isn't 100% PHP code? compuXP Client & Server Side Scripting (PHP, ASP, JavaScript) 0 18 Jul 2005 06:37 PM
Form saved as a string name? DjCalvin Web Design, HTML Reference and CSS 2 08 Mar 2005 09:30 AM
search string problem: MySQL SELECT * FROM dir WHERE multiple columns alcheme Client & Server Side Scripting (PHP, ASP, JavaScript) 3 24 Jan 2005 01:42 PM
MySQL search string only searches last word in string. alcheme Client & Server Side Scripting (PHP, ASP, JavaScript) 0 22 Jan 2005 04:32 PM


All times are GMT -5. The time now is 10:17 AM.


 

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