[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

dbclick on text

Posted on 2004-11-19
3
Medium Priority
?
677 Views
Last Modified: 2008-01-09
Hi Experts

I want to enable my users to view doctionary meaning of text on my page for this I want a simple web page with some javascript that allow a user to dbclick on any text and script will capture the text.

like :

"this is some text on web page " 

and my user dbclick on some so my script must capture "some"  text from web page and msgbox u select "Some"

Please give some time to solve this.

thanks
0
Comment
Question by:kirshan
1 Comment
 
LVL 63

Accepted Solution

by:
Zvonko earned 120 total points
ID: 12631022
Here an example:

<html>
<head>
<script>
function showSel(){
  if (document.all){
    selArea =  document.selection.createRange();
    selText =selArea.text;
  }
  else selText = document.getSelection()
  alert(selText)
}
</script>
</head>
<body onSelect="showSel()">
"this is some text on web page "
</body>
</html>

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…
Suggested Courses

834 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