How to Select text on mobile web browser by moving touch on screen using javascript? -
By turning on touch on the screen using Javascript, trying to select text from a mobile web browser on touch based mobile I am here. I do not want to use long touch to select text I am trying to get selected text like the browser on the desktop, like mobile not provided
when I try to select a text page I'm scrolling, but instead of scrolling I have to select the text.
Please provide me with a way to choose the text.
This is not a development question, and the superuser should be migrated. But to answer your question, generally in mobile, you need to tap the tap and bring the text selection toolbar.
Then you have to select the limit using two selectors.
How do you want to use it javascript? If you are selecting a category that can not be selected, then use it:
If you can use images for uneditable text, you can use an image background You can work on it by using:
body {font-family: 'verdana'; Font-size: 10pt;}. Editable (background: url ('http://i.imgur.com/cAZvApm.png') -1px 1px no-repeat; text indent: 8.5 m; margin: 0 0 10px;}
gt; & lt; / script & gt; & lt; script & gt; if (document.body .createTextRange) {var Category = document.body.createTextRange (); range.moveToElementText (document.querySelectorAll ("editable.") [0]); range.select ();} and if (window.getSelection) {var Selection = window.getSelection (); Var range = document.createRange (); Range.selectNodeContents (document.querySelectorAll ("Editable.") [0]); Selection.removeAllRanges (); Selection.addRange (range); } Document.querySelectorAll ("Editable") [0]. Focus (); & Lt; / Script & gt;
Preview:
Note: Since it is taken from my answer, I think it can not be plagiarized. agreed!
Comments
Post a Comment