views:

30

answers:

1

Need to search a string and replace value="ANYTHING" with value="", basically blank out the value. Thanks.

+1  A: 
var myString = 'blah value="ANYTHING"';
myString = myString.replace(/value="[^"]+"/, 'value=""');

Note that replace does not do anything in-place, so you have to use the returned value.

Mike Axiak