Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 9th, 2008, 03:17 PM
Registered User
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Set Selected Text inside of page body

I have a rather strange question. I am running up against a scenario where I need to change the selected text inside the body of a web page. I have an event firing that needs to move the cursor and selection from one span tag inside of a p tag to the next. Essentially what I have is this:

<p>
<span>test</span> <span>test</span> <span>test</span>
</p>

This page is written specifically for firefox and I'm using design mode so that the user can enter text. I have code so that when my event fires I move from one span to the next but I need to be able to select the contents of the span tag so that if the user starts typing it'll replace the selected text.

Any insight anyone can provide is greatly appreciated.

Casey






Similar Threads
Thread Thread Starter Forum Replies Last Post
text file in the body of e-mail mlov83 Word VBA 1 May 1st, 2008 09:18 AM
body text not inserting Jamessaep BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 April 14th, 2008 02:45 PM
Replacing text in text box inside table Larry Landis Word VBA 0 December 27th, 2007 12:03 PM
How to retrieve last selected text line in text bo garetho General .NET 1 May 3rd, 2005 09:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.