This is pretty fundamenatal and ought to be covered in any textbook. Assuming that your input is a textbox:-
Code:
<input type = "text" id = "txt1">
<br>
<input type = "button" value = "Click to get value entered into textbox" onclick = "getValue()">
<script type = "text/javascript">
function getValue() {
var val = document.getElementById("txt1").value;
alert (val);
}
</script>
The function can of course be called in different ways.
All this talk about ripping people's heads off - that going below the belt, really. - Presenter, BBC Radio 5 Live