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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -