hey all,
Am trying to display the div tag and its content by clicking it. the code below displays the whole source code when cliked on the div with id = softros. I want to make this script to display the div in view source format of the browser when clicked on any div.

Thanks in advance, looking forward for your ideas :)

Regards,
Bala

<html>

<head>
<script>
function viewSource() 
{

    window.open('view-source:'+location.href);
}
</script>
</head>
<body>
<div id="softros" onClick="viewSource();" style="border:1px red solid;">
<img src="images/rain_small.jpg" alt="rain_small" title="rain_small" />
</div>
</body>
</html>