Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
131 views

I am using document.execCommand("insertText", false, /* some text */) in a textarea to replace text while allowing Ctrl+Z undo to work; this is supported in every browser I have tested but I ...
WebCoder49's user avatar
-1 votes
1 answer
94 views

i have a contentediable div. I build the possibility, to upload image from my computer directly inside the contentediable div. Everything until here works perfect. I wrapped the image inside another ...
zazadi's user avatar
  • 1
0 votes
1 answer
123 views

I am working on a custom text editor using a contenteditable div with basic formatting functionalities. I am using the command document.execCommand("superscript", false, undefined); to do ...
Abiola Aribisala's user avatar
0 votes
1 answer
435 views

This is a contenteditable element that you can create posts on facebook.com All I want is inserting text into that contenteditable while keeping the new lines. document.execCommand("insertText&...
Ugur Kellecioglu's user avatar
1 vote
0 answers
90 views

good morning to all! I have my component to which is performed in another component a document.execCommand(action) to a selected text. The html of my component is extremely simple: <template> ...
Mauricio Vilar's user avatar
0 votes
0 answers
52 views

I am trying to share the current log file from the browser. Here I have 2 buttons which does the same. <button @click="addOpentabs">Generate Link</button> This button generates ...
adiSF's user avatar
  • 35
1 vote
1 answer
821 views

I am trying to copy a string value to clipboard using execCommand('copy') in a function which is being called when clicked on copy button. Below is the function: var s = 'some text'; function ...
yugck's user avatar
  • 11
0 votes
1 answer
309 views

I am working on a Chrome extension that highlights text in the same was as CTRL+F and I found this code that highlights text. However, upon trying to implement it, I've been running into some trouble ...
Guerlain BLANCHARD guerlblanch's user avatar
0 votes
0 answers
24 views

I've read quite a few posts on here about how document.execCommand is being deprecated and that the Clipboard API should be used instead. However I can't figure out what to replace it with. I have a ...
SeaBass's user avatar
  • 1,784
0 votes
1 answer
1k views

I don't understand why my execCommand has been striked out or cancelled: This is my code: var $temp = $("<input>"); var $url = $(location).attr('href'); $('.play_all').on('click', ...
dxmond gh's user avatar
1 vote
1 answer
2k views

Not a coding question, and the question applies to a wider tag of XYZ becoming obsolete, but asking as there seems to be tons of comments on the web about how there are so many apps out there that use ...
kenta_desu's user avatar
0 votes
1 answer
279 views

I am trying to build a WYSISYG editor, and I have an option to provide hyperlinking to a text selection. I have been scourging the internet but I am not able to find out why this isn't working sigh. ...
Aadhit Shanmugam's user avatar
1 vote
2 answers
835 views

I'm adding a background to some selected text in a contenteditable element via document.execCommand('hiliteColor', false, '#d4ecff');. If the selected text contains some formatting tags (<b></...
Lo Bellin's user avatar
  • 512
0 votes
1 answer
591 views

I have the following code, which works completely fine in Chrome/Edge/Firefox, newest versions of course, but I expect even a few year old browsers of these will work just fine. Now in Safari 15.3 (...
DenLilleMand's user avatar
  • 4,670
3 votes
2 answers
7k views

I am trying to copy text from table rows to my clipboard, however, it does not work. I have logged the text from the row in the console when it selected and it shows, however select() and document....
A.Mac's user avatar
  • 263
0 votes
0 answers
180 views

I am having a problem when copying values. I use Clipboard API but know Clipboard API only works with secure context (HTTPS), in my Beta it's only HTTP so Clipboard API doesn't work. So is there a way ...
Thien's user avatar
  • 51
1 vote
0 answers
317 views

When you want paste something in a contenteditable element by using javascript, there are two ways. Using the deprecated method document.execCommand('paste') Or using the new Clipboard API navigator....
percy507's user avatar
  • 740
-1 votes
2 answers
179 views

In a contenteditable element in which a list has been inserted with document.execCommand, is it possible to create next paragraph at the root of the editable element and not within the container of ...
David Dal Busco's user avatar
3 votes
0 answers
410 views

So, I am trying to build a WYSIWYG editor and using execCommand("bold"), execCommand("italic") etc. While they work properly, the Docs says execCommand is deprecated and might ...
noiseymur's user avatar
  • 866
2 votes
0 answers
668 views

I had some trouble finding a solution to copying a full table as exexCommand is deprecated and the Clipboard API only takes a string. I found a mix of different solutions which didn't quite make it ...
Daniel Ullander's user avatar
2 votes
1 answer
12k views

I want to read global settings programatically in Android. Using ADB on AndroidStudio, the list command works perfectly: adb shell settings list global and returns the list of settings: ... ...
Giovesoft's user avatar
  • 630
1 vote
0 answers
533 views

Recently I am trying to create a wysiwyg editor with react. I almost created basic functionality but now I am stuck with some functionality such as adding link, image, table etc. I can add this ...
Mohammad Sayem's user avatar
1 vote
1 answer
108 views

I am creating rich text editor in angular and when I execute document.execCommand('insertOrderedList') I get <ol> item which is unaffected by my component's css, only css in styles.css (main css ...
hdw3's user avatar
  • 961
0 votes
3 answers
2k views

I have a bunch of inputs on my HTML page, plus a textarea which is replaced by a TinyMCE editor. There are various scenarios where this page is loaded and every time one of the inputs must get the ...
shapou's user avatar
  • 41
2 votes
1 answer
1k views

I'm trying to programmatically highlight all occurences of a search word by adding a CSS class like so : const style = document.createElement('style'); style.setAttribute('type', 'text/css'); style....
Mouradif's user avatar
  • 2,734
0 votes
0 answers
730 views

An MUI Menu (PopOver) is open with a MenuItem for 'Copy to Clipboard' Option. The MenuItem has an <IconButton>. The onClick handler for the IconButton invokes document.execCommand('copy'). The ...
tasubha's user avatar
0 votes
1 answer
272 views

I have this text editor which i created using jquery with execCommand and a div with contenteditable but some on it isn't working only the undo and redo is working. This is my code <li data-role=&...
BrightCode's user avatar
0 votes
1 answer
429 views

I have a div whose contents the user can edit via the contenteditable attribute. When the user types something in the div, a function is called. I am using the oninput event to trigger that function, ...
MikeMichaels's user avatar
1 vote
0 answers
203 views

As mentioned in the title of the question, I am using window.setTimout in my application. Here is the detailed explanation. When a user clicks a button I call a function, passing the value that needs ...
Shahe's user avatar
  • 984
0 votes
2 answers
2k views

I have a function that gets the last character of a string the user types in an input. But how do I select that single character, using execCommand()? The goal is to copy it into a different input. I ...
MikeMichaels's user avatar
0 votes
0 answers
103 views

Use selection.addRange(range) for insert html near default text, but this action doesn't save into history of input, and when i use ctrl+z, undo previous action, not change(insertNode) I need, that ...
Roman's user avatar
  • 1
1 vote
1 answer
941 views

I would like to make an editor from scratch with a contenteditable div in react.js The div is editable, but how can I add a button to make selected text bold? I tried "document.execCommand('bold',...
Alexander Juhl's user avatar
-1 votes
1 answer
211 views

Can I delete first character using execCommand function in JavaScript? So, I need to that: "My string..." document.execCommand('...'); "y string..." I have code that; $('#myDiv')....
K. Yılmaz's user avatar
0 votes
0 answers
81 views

I have an editable div in my HTML and I am inserting an SVG element in the same. The element is as follows: <svg width="1.5em" height="1.5em"><use xlink:href="...
Raj's user avatar
  • 437
2 votes
1 answer
5k views

I'm executing gcloud command inside the remote host. However, when I try to execute any command using the ssh.exec_command, the command seems to get executed. But how can I make sure it executed ...
Pepper's user avatar
  • 75
1 vote
0 answers
120 views

lets say I have a div with content-editable = true. Now i want to color selected/highlighted text inside that div. I am using document.execCommand("foreColor", false, color) where color is ...
shiva shukla's user avatar
0 votes
0 answers
245 views

document.execCommand("fontSize", false, value); i am getting the third parameter "value" from the user which is in "pixel". but execCommand only allows the input between ...
shiva shukla's user avatar
1 vote
0 answers
93 views

I'm using a contenteditable div to set up a basic editor. The content includes some elements that are "atomic" -- they're placeholders that aren't themselves editable. However, when the user ...
Jason Cooper's user avatar
0 votes
1 answer
347 views

In my custom-editor wrapping up the code in <pre> tags works fine. I would like to visually organize the pasted code for better readability. For that I need blank lines in between chunks of code....
gurung's user avatar
  • 618
0 votes
1 answer
125 views

Presumably, I know where's the problem but I have no idea how to fix it. I've got an editable div and <small> elements, clicking on which I want text (that was selected) to be styled. But the ...
h1kiga's user avatar
  • 84
1 vote
0 answers
154 views

I am trying to make it so when I changed the colour of an editable <div> tag it changes all the text to that colour. When I use the line document.execCommand('foreColor', false, 'blue'); to ...
WIverson97's user avatar
0 votes
2 answers
654 views

So I have made this webpage wherein it is a pseudo RTF editor that inserts data into the database. Insert into php the html in a div I am having a problem when it comes to text styling the text typed ...
Xe Pueblos's user avatar
15 votes
2 answers
14k views

I am building an amateur rich text editor with vanilla JavaScript and document.execCommand() is essential to enabling the core features of an text editor. For example bold, italic and unordered list ...
Linas M.'s user avatar
  • 332
1 vote
0 answers
974 views

When trying to use insertHTML document.execCommand('insertHTML', false, `<b id="searchId${numberID}" style="background-color: ${color};" >${text}</b>` Works fine in any browser except ...
silphonix's user avatar
0 votes
0 answers
144 views

because execcommand is obsolete : https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand. i do work on a knowledge network, we use a markup language just like markdown, but is more ...
defend orca's user avatar
0 votes
1 answer
253 views

Here is the JS fiddle for this problem: https://jsfiddle.net/2ds5mor4/1/ Open JS fiddle in chrome and IE Edge. Paste (ctrl+V) in text area and you will see the text which is not formatted in IE Edge ...
Vinay Dhakre's user avatar
311 votes
12 answers
195k views

I intended to use Document.execCommand() method along with contenteditable attribute to build my custom WYSIWYG editor. But when I checked the documentation for Document.execCommand(), I found that it'...
Omar's user avatar
  • 7,821
0 votes
3 answers
1k views

I'd like to make text in <i> tag not appear italic in a contenteditable div. However, as you can see in the code snippet below, if I add font-style:normal to italic style, document.execCommand('...
yoonchae lee's user avatar
-1 votes
1 answer
1k views

I have got a contenteditable div element and a button as such <button onClick="backColor();">Change BC</button> <div contenteditable="true"></div> inside the body of my index....
RealAnwersOnly's user avatar
0 votes
1 answer
621 views

I am trying to indent and outdent in a contenteditable div. The indenting works perfectly but the outdent execCommand isn't working. I have a last key buffer that works for other keyboard shortcuts ...
Anthony Lavender's user avatar

1
2 3 4 5 6