Solved

Unselect textarea...

Posted on 2006-07-13
2
1,173 Views
Last Modified: 2008-02-01
I have a bit of JS
  theForm.body.value=theForm.body.value.split(sel).join(url+' ')

that modfiies the contents of a text area, problem is that once its done all the text in the textarea is selected. Is there a way to unselect the textarea automatically when its done?
0
Comment
Question by:fox_statton
  • 2
2 Comments
 
LVL 30

Expert Comment

by:third
Comment Utility
try to call

theForm.body.focus()

or focus to any other field on the form.
0
 
LVL 30

Accepted Solution

by:
third earned 500 total points
Comment Utility
another way is to blur from you field

theForm.body.blur()

but of course blurring will lose focus to your textarea.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now