How to edit HTML formatted text programatically with javascript without dealing with tags and HTML manually -


i want able edit html formatted text if plain text without losing formatting. example let's have html:

<div> <b> <span style="color: rgb(68, 68, 68);">gmail available <i>wherever</i>  are, device - desktop, laptop, phone or tablet. download app or go to&nbsp;</span><a href="https://www.gmail.com/">gmail.com</a><span style="color: rgb(68, 68, 68); font-family: arial, sans-serif; line-height: 18.1875px;">&nbsp;on mobile device started. </span> </b> <br> </div> 

i able like:

trimmed = gettexttoedit(); tokens = trimmed.split(' '); replacement = "+"; (var i=0; i<tokens.length; i++) {     t = tokens[i].tolowercase();     if (t == "gmail") t = replacement;  } 

and have t, still formatted.

is there way can edit text without manually dealing html tags , still keeping formatting? ok using library this.

thanks!

i think need html-parsing javascript.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -