<script type="text/javascript">
function selectext()
{
document.getElementById('TheDiv').innerHTML.select()
}
</script>
<input class="button" type="button" value="Select Codes" onClick="selectext()">
<div id="TheDiv'">
<html>
<head>
<title></title>
</head>
<body>
Select Me
</body>
</html>
</div>
The codes in above doesnt work. Actually it was working when i put textarea tag instead of div tag. But i want to use div tag.