I have a small problem with a regular expression in javascript
I use this one for putting double quotes around html tags
for example border=0 will became border="0"
unclean = unclean.replace(/ ([^=]+)=([^"' >]+)/gi," $1=\"$2\"");
It searches for = and then put the "" around the html tags
However I have one problem with javascript in html
for example
document.write("<a href=\"javascript:popUp
will became document.write("<a href="\""javascript:popUp
and
document.write("&js=on');
will became 'atedocument.write("&js="on'");
My question is how to escape everthing if it defined into a script tag
<script
Thanks for any help I am really stuck here :)