html - How to change color with new tag in javascript? -


in html file have change color new tag.it changed permanently.if it's possible do.now using below code:

function alertselection() {       var range = window.getselection().getrangeat(0),       content = range.extractcontents(),       span = document.createelement('b');       span.appendchild(content);        var htmlcontent = span.innerhtml;        range.insertnode(span); } 

when press refresh old one.how create tag when selecting.

whenever want change style through use style

element.style.css attribue = value

example: span.style.color = "green";


Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -