jquery replace char code example
Example 1: jquery replace element
$("elementsSelector").replaceWith( "<h2>New content</h2>" );
Example 2: replacing characters in string javascript
var myStr = 'this,is,a,test';
var newStr = myStr.replace(/,/g, '-');
console.log( newStr ); // "this-is-a-test"