Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

execute command method

<!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 :: callback function js 
Javascript :: find smallest length string in an array js 
Javascript :: jquery datepicker on multiple input fields 
Javascript :: regex check if number is greater than 
Javascript :: datatables cdn 
Javascript :: vscode react extensions 
Javascript :: javascript function return multiple 
Javascript :: search string for character javascript 
Javascript :: angular 9 radio button checked 
Javascript :: adding a timer in a quiz game 
Javascript :: javascript remove string between 
Javascript :: odd even javascript 
Javascript :: async function js 
Javascript :: typeof javascript 
Javascript :: change image on click javascript 
Javascript :: jquery check is select 
Javascript :: wait for promise javascript 
Javascript :: how to check if array 
Javascript :: split string every nth characters javascript 
Javascript :: csv upload with react 
Javascript :: update map value javascript 
Javascript :: ng-pick-datetime 
Javascript :: show the time zone of browser javascript 
Javascript :: how to create a pop up in middle screen javascript 
Javascript :: car image api free 
Javascript :: jquery select input 
Javascript :: live search javascript 
Javascript :: on reload js 
Javascript :: send post request 
Javascript :: fetch json data into array 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =