I don't know much about DW, but this script will do that. Just place it in the head of your page and open it in a browser (FF is best for this, others will work OK).
It will superimpose the commented code at the top of the page in a text area. You may then copy and paste that code over the contents of the body tag in your source code, and then remove the script.
Demo:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
/* Comment Division End Tags script ©2008 John Davenport Scheuer
as first seen in http://www.dynamicdrive.com/forums/
username:jscheuer1 - This notice must remain for legal use
*/
function commentEndTags(){
for (var c, d = document.getElementsByTagName('div'), i = d.length - 1; i > -1; --i)
if(d[i].id || d[i].className){
c = document.createComment(' end div' + (d[i].id? ' id:' + d[i].id : '') + (d[i].className? ' class:' + d[i].className : '') + ' ');
if(d[i].nextSibling)
d[i].parentNode.insertBefore(c, d[i].nextSibling);
else
d[i].parentNode.appendChild(c);
}
var commented = document.createElement('textarea');
with (commented){
rows = 20;
cols = 80;
wrap = 'off';
with (style){
position = 'absolute';
zIndex = 10000;
top = '0px';
left = '0px';
overflow = 'auto';
}
}
commented.value = document.body.innerHTML;
document.body.appendChild(commented);
}
if(window.addEventListener)
window.addEventListener('load', commentEndTags, false);
else if(window.attachEvent)
window.attachEvent('onload', commentEndTags);
</script>
</head>
<body>
<div id="rwf_OuterContainer">
<div id="rwf_MainContainer">
</div>
</div>
<div id="bob" class="otherContainer">
</div>
</body>
</html>
Sample output for above demo (using FF):
Code:
<div id="rwf_OuterContainer">
<div id="rwf_MainContainer">
</div><!-- end div id:rwf_MainContainer -->
</div><!-- end div id:rwf_OuterContainer -->
<div id="bob" class="otherContainer">
</div><!-- end div id:bob class:otherContainer -->
Bookmarks