<input type="text" id="xx" /> <button type="button" onClick="tel()">envia</button> <script> function tel() { var num=document.forms.NOMBREFORMULARIO.xx.value; alert(num); </script>