<style type="text/css">
div[class] {
border:red solid 1px;
width:130px;
margin:2px;
padding:6px;
}
div[id] {
width:230px;
height:40px;
padding:6px;
border:blue solid 1px;
}
</style>
<script type="text/javascript">
function change1(elem) {
var a=elem.className;
var b='';
if(a=='products') b = 'Текст для products';
if(a=='main') b = 'BLa-BLa-Текст для main';
document.getElementById('center').innerHTML = b;
}
</script>
<div id="center"></div>
<br />
<br />
<div onclick="change1(this)" class="main"></div>
<div onclick="change1(this)" class="products"></div>