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(/\⇒\;/ig,"⇓")
Comments
Post a Comment