jquery - Remove '|' special character from a string -


my question may find simple, not getting right. how remove "|" string far have used following not working

<div class="inner"> | abcd || </div> var txt=divvar.html(); 

1) txt=txt.remove("|");

2)txt=txt.replace (/|/g, '');

you have escape '|' character:

txt=txt.replace (/\|/g, ''); 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -