candro, проще всего наверное так
<html>
<head>
<meta charset="windows-1251">
<style>
.block1{background: red}
.block2{background: green}
</style>
</head>
<body>
<div id="wrap">
<div class="block1">block1</div>
<div class="block2">block2</div>
</div>
<script>
wrap=document.querySelector("#wrap")
;(function(){
var re=/<div\s+class\s*=\s*['"]\s*block1\s*['"]/,
block=wrap.innerHTML,
block=block.replace(re, "<div class='block2'")
wrap.innerHTML=block
})()
</script>
</body>
</html>