I have a string and i want to replace the html attribute that contained in it...The structure look like this:\[code\]<script> var string = '<img src="http://stackoverflow.com/questions/13860920/aaa" alt="aaa"/>'; string.replace(); WHAT SHOULD I DO ?</script>\[/code\]and i want the result like this:\[code\]<script> var string = '<img src="http://stackoverflow.com/questions/13860920/aaa"/>';</script>\[/code\]I know the regex, but how to do ?Thanks for advance !