I am working on a task to substitute
<script type='text/javascript'>some stuff</script>
with:
<div type='text/javascript'>some stuff</div>
My current testing method involves:
alert( o.replace( /(?:<\s*\/?\s*)(script)(?:\s*([^>]*)?\s*>)/gi ,'div') );
However, the result I'm getting is:
divsomestuffdiv
Is there a way to only replace the "script" part while maintaining the other HTML tags and attributes?