<script type="text/javascript">
window.onload = function() {
document.getElementsByName('input')[0].onclick = function() {
alert(document.getElementById('div').innerHTML);
};
};
</script>
<input type="button" name="input" value="click" />
<div id="div" style="display: none;">some text</div>