Thursday, April 19, 2012

Replace special characters in JavaScript

How to replace '$txt$' in javascript.I want to replace all occurrences in the string



It's what i tried



if (html.indexOf('$txt$') > -1) {
html = html.replace(/$txt$/ig, '<input type=text></input>');
}


but it won't replace the string.What's my mistake.Please help me





No comments:

Post a Comment