Questions tagged [textselection]

In User Interface Design, text selection is the method of handpicking a portion of text, most commonly for the purpose of copying/cutting/pasting.

In User Interface Design, text selection is the method of handpicking a portion of text that will be further acted upon by the user. The selection is done by the interaction devices provided by the user interface.

Text selection is most commonly associated with the user actions of copying, cutting, and pasting. In Graphical User Interface, text selection is performed by a mouse or touch represented as cursors.

415 questions
5532
votes
49 answers

How to disable text selection highlighting

For anchors that act like buttons (for example Questions, Tags, Users, etc. which are located on the top of the Stack Overflow page) or tabs, is there a CSS standard way to disable the highlighting effect if the user accidentally selects the text? I…
anon
384
votes
5 answers

Get the Highlighted/Selected text

Is it possible to get the highlighted text in a paragraph of a website e.g. by using jQuery?
Dan
  • 3,881
  • 3
  • 13
  • 3
281
votes
5 answers

How do I disable text selection with CSS or JavaScript?

I am making a HTML/CSS/jQuery gallery, with several pages. I indeed have a "next" button, which is a simple link with a jQuery click listener. The problem is that if the user click the button several times, the text of the button is selected, and…
daviddarx
  • 3,215
  • 3
  • 16
  • 23
205
votes
4 answers

How to make HTML Text unselectable

I would like to add text to my webpage as a label and make it unselectable. In other words, When the mouse cursor is over the text I would like it to not turn into a text selecting cursor at all. A good example of what I'm trying to achieve is the…
Ben
  • 9,162
  • 21
  • 89
  • 151
142
votes
16 answers

Is there a way to make text unselectable on an HTML page?

I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers. I might be able to solve this with a…
Tyler
  • 27,580
  • 11
  • 83
  • 103
122
votes
10 answers

IntelliJ Column Selection using Cursor Keys

Is it possible to some how setup IntelliJ IDEA so that I can column select with the cursor keys similarly to how I might in Notepad++, Visual Studio, or FlashDevelop. For instance when I'm typing code I almost always do my navigation solely through…
46
votes
9 answers

How to override default text selection of android webview os 4.1+?

Before posting this question I've searched a lot but could not find any clear answers on this issue. I have to override default text selection of android webview & show my custom text selection dialog options. I have tried this sample code…
sachin003
  • 8,573
  • 4
  • 19
  • 23
42
votes
4 answers

Why is .disableSelection() deprecated?

.disableSelection in JQueryUI 1.9 is deprecated. The only explanation I can find is, literally, "Disabling text selection is bad. Don't use this." and "We shouldn't allow developers to mess with text selection. This was originally for the…
Jason Kleban
  • 18,057
  • 15
  • 68
  • 116
40
votes
2 answers

IOS: Text Selection in WKWebView (WKSelectionGranularityCharacter)

I've got an app that uses a web view where text can be selected. It's long been an annoyance that you can't select text across a block boundary in UIWebView. WKWebView seems to fix this with a property on its configuration: selectionGranularity. …
Tom Hamming
  • 9,484
  • 9
  • 66
  • 131
39
votes
6 answers

How to get selected text from textbox control with javascript

I have a textbox and a link button. When I write some text, then select some of them and then click the link button, selected text from textbox must be show with a messagebox. How can I do it? When I click the submit button for textbox below,…
mavera
  • 2,821
  • 6
  • 42
  • 57
36
votes
3 answers

Coordinates of selected text in browser page

I need the coordinates in pixels of the beginning of the text selection (anywhere on the page, not in a textarea). I tried using the cursor coordinates but this didn't work quite well because the cursor coordinates and the beginning of the selection…
Bouke
  • 611
  • 1
  • 7
  • 20
32
votes
9 answers

Disabling text selection in PhoneGap

Is it possible to disable text selection to make a PhoneGap app more similar to normal native app? Something like this: document.onselectstart = function() {return false;} or: * { user-select: none; -moz-user-select: -moz-none; -khtml-user-select:…
stmn
  • 330
  • 1
  • 4
  • 8
31
votes
4 answers

How to disable cursor positioning and text selection in an EditText? (Android)

I'm searching for a way to prevent the user from moving the cursor position anywhere. The cursor should always stay at the end of the current EditText value. In addition to that the user should not be able to select anything in the EditText. Do you…
Louis
  • 2,011
  • 4
  • 17
  • 18
26
votes
2 answers

Can you set and/or change the user’s text selection in JavaScript?

In JavaScript, there are various methods for accessing the user’s text selection, and creating text selections (or ranges) — see http://www.quirksmode.org/dom/range_intro.html. As per that page, you can programmatically create a range, and access…
Paul D. Waite
  • 89,393
  • 53
  • 186
  • 261
26
votes
2 answers

Set selection by range in Javascript

I want to select text by sending location/anchorOffset and length/offset using Javascript Here is my code var node = document.getElementById("content"); var range = document.createRange(); range.setStart(node, 0); range.setEnd(node, 4);…
Shinning River
  • 783
  • 1
  • 9
  • 23
1
2 3
27 28