javascript - Detect a specific html entity character and replace it with another one -


using javascript, want test presence of right arrow character ⇒ in string , replace down arrow character ⇓ basically, this:

if ( node.innerhtml.indexof("⇒")!==-1 ) { var text=node.innerhtml.replace("⇒","⇓");                          node.innerhtml=text; } 

unfortunately, above code not work.

the ascii code above are

⇒ , ⇓ 

so suppose have detect presence of specific ascii code in string , replace one. know how that?

assuming replace text not property value of html element or if that's it's ok replace try:

node.innerhtml=node.innerhtml.replace(/⇒/ig,"⇓").replace(/\&#8658\;/ig,"⇓") 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -