Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

execcommand js

<!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 :: display time and date in javascript 
Javascript :: edit external json file in javascript 
Javascript :: placeholder text disappear when click in react 
Javascript :: express referrer 
Javascript :: nodejs: http:send HTML to the Browser 
Javascript :: make angular to run on a different port 
Javascript :: copy element jquery 
Javascript :: JS clickable checkbox 
Javascript :: js remove specific item from array 
Javascript :: how to set a timeout on an array element 
Javascript :: js add multiple element to document 
Javascript :: coffeescript to javascript 
Javascript :: async function javascript 
Javascript :: creating a module with lazy loading in angular 9 
Javascript :: toastr options 
Javascript :: Javascript add leading zeroes to date 
Javascript :: constant expression contains invalid operations laravel 
Javascript :: javascript find object in array by property value 
Javascript :: javascript between 
Javascript :: var x = 
Javascript :: append to map javascript 
Javascript :: convert set to array javascript 
Javascript :: pattern alphabet and space 
Javascript :: for loop array 
Javascript :: how to make a github api using react 
Javascript :: window resize done 
Javascript :: convert namednodemap to object 
Javascript :: Difference in months between two dates in Javascript 
Javascript :: axios post request javascript 
Javascript :: get json data into object 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =