User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 455,985 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,795 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 2286 | Replies: 5
Reply
Join Date: Dec 2007
Posts: 1
Reputation: chauhansanjiv is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chauhansanjiv chauhansanjiv is offline Offline
Newbie Poster

Changing Background Color

  #1  
Dec 3rd, 2007
Hi Frnds,
Can Anyone tell me, how can I ,
Change the BACKGROUND color of selected text in TEXTAREA

sanjiv
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,604
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 119
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Changing Background Color

  #2  
Dec 4th, 2007
1. Assign an id or a class to the textarea.

2. For css, assign a color string ("#rrggbb") to background-color for the id or the class.

3. For JavaScript control, use a statement such as this:

document.forms.myid.style.backgroundColor = colox;

where colox contains a color string.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,009
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 25
Solved Threads: 368
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Changing Background Color

  #3  
Dec 4th, 2007
You misread the requirements. The task is to change the background color of the selected text in a textarea and not the background color of the textarea.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Join Date: Aug 2007
Posts: 10
Reputation: ruman_eee is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
ruman_eee ruman_eee is offline Offline
Newbie Poster

Re: Changing Background Color

  #4  
Dec 5th, 2007
If you know that then why you didn't give him the answer ?
try to give them a positive answer not to discourage ...
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 7,009
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 25
Solved Threads: 368
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Changing Background Color

  #5  
Dec 5th, 2007
> If you know that then why you didn't give him the answer ?
Because there is none.

> try to give them a positive answer not to discourage ...
You should look for answers and not pleasing words.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Join Date: Jan 2007
Posts: 2,604
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 119
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Changing Background Color

  #6  
Dec 9th, 2007
If you want to change the color the selection becomes when selected, that is a Windows setting, not a web setting. The setting is in the Control Panel, and is under the control of the owner of the computer, not the webmaster.
Daylight-saving time uses more gasoline
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 9:28 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC