Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

js on highlight

document.addEventListener("selectionchange",event=>{
  let selection = document.getSelection ? document.getSelection().toString() :  document.selection.createRange().toString() ;
  console.log(selection);
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #highlight
ADD COMMENT
Topic
Name
8+5 =