Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 30th, 2009, 01:21 PM
Authorized User
Join Date: Feb 2006
Location: jaipur, rajasthan, India.
Posts: 67
Thanks: 7
Thanked 0 Times in 0 Posts
Send a message via Yahoo to beetle_jaipur
Default How to change background color of text


i want to make a tool which can change text background color with mouse drag...using javascript

this is sample text.

i want to prepare a script. so that when i start dragging with mouse it changes the text color like when i start drag at s.. it immediately starts changing background color (yellow) of that selected text...

same as highlight tool.... but i do not want to click any button for it... just this tool should be available for text whenever i drag it anywhere on html/asp page..

any guideline/suggestion/resource are most welcome....
i am trying for last may days.. but could not find any appropriate method...

thanks for your consideration

best regards
ashok sharma
Reply With Quote
  #2 (permalink)  
Old December 1st, 2009, 02:03 AM
Friend of Wrox
Points: 742, Level: 10
Points: 742, Level: 10 Points: 742, Level: 10 Points: 742, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Nov 2009
Location: Tehran, Iran
Posts: 156
Thanks: 13
Thanked 16 Times in 16 Posts
Default use jQuery

You can perform it using jQuery. Are you familiar with jQuery?
It is a javascript library that enables you to any visual tasks like dragging windows, made any picture rounded, etc.
for example notice following:
$("div > p").css("border","solid #0C0C0C 1px");
this means that change "border" propery of every "p" tag that is nested into a "div" tag, to "solid #0C0C0C 1px".

I put some files in my blog for you. by these you can learn to perform what you wanted and other things.





jquery.js in main javascript library. you can even get a link from Google servers.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change background color using CSS pigtail Javascript How-To 9 April 4th, 2010 11:13 AM
change color of background meena88 C# 2005 3 December 1st, 2009 04:48 AM
change background color of inputbox vickriz Javascript How-To 3 December 1st, 2009 02:22 AM
Change the background color of a msgbox nobreferreira VB.NET 2002/2003 Basics 3 October 28th, 2004 09:37 AM

All times are GMT -4. The time now is 06:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.