html5 - JavaScript document.execCommand() own tags -


i've found interesting! execcommand function applies many useful features. possible work own wraps? like:

document.execcommand("stylewithcss", false, "<span class='own-class'>"); 

everything related i've found pretty old… maybe 1 of knows workaround or something.

thanks dandavis.

the following works well:

document.execcommand("inserthtml", false, "<span class='own-class'>"+ document.getselection()+"</span>"); 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -