Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

execcommand javascript

<!DOCTYPE html>
<html>
<body onkeydown="myFunction(event)">

<h1>The Document Object</h1>
<h2>The execCommand() Method</h2>

<p>The executeCommand() method executes a specified command on selected text.</p>
<p>Select some text in this page, and press SHIFT to make the selected text toggle between bold and normal.</p>

<script>
document.designMode = "on";

function myFunction(event) {
  if (event.keyCode == 16) {
    // Execute command if user presses the SHIFT button:
    document.execCommand("bold");
  }
}

</script>

</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: toggle boolean state react 
Javascript :: vue localstore 
Javascript :: node terminal readline console 
Javascript :: init select2 jquery 
Javascript :: fetch from vscode 
Javascript :: Invariant Violation: "main" has not been registered. This can happen if: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project. 
Javascript :: javascript Set Intersection Operation 
Javascript :: trigger a function inside child from parent vue 
Javascript :: reverse array js 
Javascript :: how to change background color using js 
Javascript :: angular conditionally show tooltip 
Javascript :: webpack babel loaders/plugin installation 
Javascript :: js find duplicates in array 
Javascript :: react-select 
Javascript :: Deploying Node.js Apps on Heroku 
Javascript :: jsx loop array 
Javascript :: generate express app 
Javascript :: delete element javascript 
Javascript :: reverse integer in javascript 
Javascript :: http header express 
Javascript :: promise with timeout js 
Javascript :: javascript change content of h element 
Javascript :: Duplicate empty header occur in datatable when enabling scrollX or scrollY when using Google Chrome 
Javascript :: Add an item to the beginning of an Array 
Javascript :: how to detect click outside div 
Javascript :: map function react 
Javascript :: While resolving: gatsby-starter-ghost@2.0.0 npm ERR! Found: react@17.0.2 
Javascript :: jquery api 
Javascript :: post request with data and headers 
Javascript :: iife in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =