Grabbing Highlighted/selected Text

Apr 27, 2007

I am wondering if it is at all possible to create a button that--when
clicked--grabs a paragraph of text that a user has highlighted. So you
go to this website, then highlight a section of text. Once you have
the text selected with you mouse, you then click the button. The
button executes a function which acquires the selected text in a
string. Is this hypothetical situation possible? Thank you for the
time it took to read this post.

View 1 Replies


ADVERTISEMENT

Remove Style From Selected (Highlighted) Span / Text In DIV

Aug 1, 2010

I have many divs with spans inside(just like it is below-no extra ids,classes for spans:
[...]
<div>
<span style="color:red;">a</span>
<span style="color:blue;">b</span>
<span style="color:white;">c</span>
</div>
<div>
<span style="color:red;">d</span>
<span style="color:blue;">a</span>
<span style="color:white;">a</span>
</div>
[...]

What I would like to achieve: user selects with mouse "ab", click button(input type=button) which remove style from selected span/spans. Similar behavior like it is in TinyMCE.

View 6 Replies View Related

Selecting Highlighted Text

Aug 11, 2006

It needs to allow the user to highlight some text within a paragraph. If the correct text (with an error) is selected it should provide feedback that the user has correctly selected this text.

So what I need to do is

1. Get the text selection
2. Compare this text selection to a predefined answer
3. Provide feedback to the user e.g. they are correct if text selection = predefined answer, and incorrect if text selection != predefined answer

View 3 Replies View Related

Grabbing Text From Within A Header Tag?

Jul 13, 2010

I know this can be done with form elements but I'm curious if this can be done with headers.

Code:
<h3 id="headTxt">Blah Blah</h3>

I'm trying to grab the Blah Blah text.

I've tried innerHTML but to no avail. (Does it have to be wrapped in a container?) Or is innerHTML a replace only?

View 9 Replies View Related

Grabbing Text From Page?

Jan 6, 2010

While on vacation I've been writing a bunch of javascript/css text effects for fun and I'm planning to look into how I can implement my code inside a url. So now I want to know how I can recognise and grab the text from any random webpage and put it inside of a variable, my script can take it from there.

View 8 Replies View Related

Searching For Highlighted Text On Webpage?

Feb 24, 2009

Is there a way of searching for highlighted words on a webpage?

View 4 Replies View Related

How To Determine Neighbors Of Highlighted Text

Aug 13, 2010

I am a JS newbie and I'm wondering if there a way to figure out the sentence from which a word has been highlighted. Essentially, when a user selects a word or a phrase, I should output the sentence from which it's been selected. Is this possible with JS or with any server side languages?

View 2 Replies View Related

Grabbing ASCII Values In A Text Box

Mar 10, 2006

I have a function that lets me convert one character and throw an alert
with the corresponding ASCII value, but what I am having trouble with
is applying it to a text box. What I'm trying to do is when characters
are entered the function will loop through the entered values and throw
an alert for each of the corresponding ASCII values for each of the
characters entered. I am trying to alert the user for every character
that is out of the range of ASCII equivalent 1 - 128. Test code:

View 1 Replies View Related

JQuery :: Grabbing Text Inside An Alt Tag?

Apr 29, 2009

Is there a way to grab the text from inside a alt tag?I have a sitethat will have tons of span tags and I need to go through all of themsearching for the alt="" attribute then grab it.I'm using some non-jQuery javascript, so I'm sure there is an easierway to format this than what I currently have.----- html example:

<span>text here</span>
<span alt="Joe">text here</span>
<span alt="Jim">text here</span>

[code]....

View 2 Replies View Related

Find Start And End Of Highlighted Text In String

Feb 15, 2007

I am creating a little html editor, and I want to highlight a chunk of
unformatted text, click a <buttonand put a <pand the beginning and
a </pat the end. I assume there is a DOM element relating to this,
can anybody help please ?

View 1 Replies View Related

Grabbing Text From Webpage To Display On Another Page

Aug 19, 2011

I am trying to place text output from a url on another webpage.The output is the status of an alarm system.hash and mac info remove for security reasons.I would like to place these three outputs on another page.

View 2 Replies View Related

JQuery :: Grabbing Specific Part Of A String Of Text?

Jun 10, 2011

I'm trying to grab a specific part of a string of text and am wondering how to do it (or if it is possible to do it) with a jQuery selector.Is there any way to get that specific part of the link?

View 2 Replies View Related

Grabbing Single ASCII Values Pasted Into A Text Area

Mar 10, 2006

Here's what I have so far, which handles characters
as they're typed in. Could someone please show me how I would loop
through all the values that are entered if a block of text was pasted
in, and then grab the ascii value(s) that are > 128?: Code:

View 1 Replies View Related

Change Selected On Dropdown When A Text Form Is Selected Or Input Is Added?

May 19, 2010

like for example i have text areas named upload1 and upload2when I click or add input on upload1 a drop down list below upload2 will not change, but when I add input on upload2 the dropdown will select "parts"

View 3 Replies View Related

Get The Cursor Start And End Position Of A Selected Range In A Text-field Or Text-area

Jun 17, 2010

I want to get the cursor start and end position of a selected range in a text-field or text-area. i tried lot of functions in various forums. but when the last character of the selection is a new line character JavaScript ignore it in IE6. any one having idea ?

View 1 Replies View Related

Show Text Box When Check Box Is Selected + View Text Box

Nov 4, 2011

I wanted to show text box when check box is selected , it doesnt work...

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="jquery.js"></script>
[Code]...

View 3 Replies View Related

Wrapping Tags Around Selected Text In A Text Area!!

Jun 16, 2006

I'm trying to 'wrap tags' around text in a text box.

<script language=javascript>
function insertFauxTags(fauxTag, e, endFauxTag)
{
var e = document.frmAddNewForum.txtTopicMessage.selected;
document.frmAddNewForum.txtTopicMessage.Value += fauxTag + e + endFauxTag;
}
</script>

And my form:

<form runat="server" id="frmAddNewForum">
<asp:textbox id="txtTopicMessage" runat="server" cssclass="formtext" rows="5" textmode="MultiLine" width="95%" style="width:95%"></asp:textbox>
</form>

And here's how I'm calling the function:

<a href="javascript:insertFauxTags('[p]' + e + '[/p]')"><img src="http://www.<%=strSiteName%>/images/parabutton.gif" border="0" alt="Paragraph" /></a>
When I run this in FF I get 'e' is not defined - any ideas?

View 1 Replies View Related

Passing The Selected Text From List Into Text

May 24, 2010

I want passing the selected text from list into text. i dont know how to do nu. I attached screenshot with this thread.

View 7 Replies View Related

Text In Text Box Has Been Selected Forwards Or Backwards?

Aug 16, 2010

Is there a way to tell if the text in a text box has been selected forwards or backwards?If you select some text from left to right and then hold down shift and use the cursor keys the right end of the selection moves. If you select some text from right to left and then hold down shift and use the cursor keys the left end of the selection moves.Is there a way in Javascript to detect which way the text has been selected? I need to know if the "end" position is before the "start" position or after. Using ranges and selection objects seems to "normalise" the selection so that the start is before the end.

View 2 Replies View Related

JQuery :: Nav Bar - Highlighted By Current DIV

Jun 21, 2010

I have a navbar numbered 1 thru 6 for a slider. You can see it here. [URL]. Is there a way to have the current navigation number share the rollover state? In other words, if I slide to #4 then the actual navbar #4 displays in a different color until I navigate away from it. I originally thought that this would be a simple CSS thing, but that idea went more towards javascript 'test'. Then I wondered if there might be a plug-in for this sort of thing.

View 11 Replies View Related

Grabbing The File Name?

Aug 9, 2005

Is there any way via JS to grab the name of the file that its running?

I want an external JS loaded onto a page to enable a function when something is clicked that it passes control over to another page but adds the name of the file that is currently running as one of the URL parameters.

Perhaps there is a clever way to get it off the URL?

View 1 Replies View Related

Grabbing The Children’s Of An ID

Mar 18, 2010

I have this code running:

[Code]...

The problem I'm having is that id GlobalList has CSS childs and when I click within the DIV if its not GlobalList then it closes out. I'm trying to see how I can modify it, so it won't close if I click within the DIV structure

[Code]...

View 4 Replies View Related

Keep Highlighted Item In Image Map Rollover?

Jun 12, 2009

i'm using a great script from oreilly for an efficient rollover effect on an image map - highly recommend for anyone needing something like this - link is below - my question is how do i modify it so the menu item *stays* highlighted when the page is selected? that is, in the example, if you rollover or click 'home', the image changes, but once you select it, the effect goes away. i've tried a few things but am getting bogged down as to the best approach. [URL]

View 9 Replies View Related

Unhighlighting A Previously Highlighted Table Row?

Apr 24, 2010

I've got the following code inside a js function that highlights the table row (multiple, dynamic number of rows) onclick. But I'm trying to figure out a way to "unhighlight" that previously highlighted row back to what it was before the user clicked on it. Is it possible to save-off the "this" so that it's the "previous this" ? [code]...

View 1 Replies View Related

Grabbing A DOM For Use With Google Maps

Oct 13, 2005

I am messing around with Google Maps a little and the fundamental difficulty in building anything useful is extrapolating address information from another website. I would like to be able to use a form like yahoo yellow pages send it a zip code and get back a bunch of, say, banks in that zip code and parse the address out. Some things, very few, actually return data in the XML format, but how do you write a script that send a request to a website and then returns that request as a DOM object. I'll even take HTML and then I'll parse it out myself, but how do you do that.

I know it sounds fundamental, but I'm a real beginner in this, so if you can push me in the right direction I would appreciate it too.

View 4 Replies View Related

Grabbing Msn Contact List ?

Mar 15, 2010

Is there a way for a website to grab a users msn/hotmail contact list and send email to those users if the user wants to? Like an invite to a web page. Is this hard to achieve?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved