/    Sign up×
Community /Pin to ProfileBookmark

Background Color Syntax

I am trying to let the user change the background color of the table and I can’t find the correct syntax needed. I was able to do the color fine. The code is below:

[CODE] <label><strong>Background-Color:</strong>
<select name=”selectcolor” onchange=”document.getElementById(‘tblTimer’).style.bgcolor=this.value;”>
<option value=”RED”>RED</option>
<option value=”BLACK”>BLACK</option>
<option value=”ORANGE”>ORANGE</option>
</select>
</label> [/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991May 23.2010 — [url=http://www.quackit.com/css/css_bgcolor.cfm]CSS bgcolor[/url].

.style.backgroundColor = this.value;

And hyphens in CSS properties are converted into CamelCase, so background-color turns into backgroundColor.
Copy linkTweet thisAlerts:
@tvb2727authorMay 23.2010 — Thank you.
×

Success!

Help @tvb2727 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...