Show input value

by Eduard Kulikov

HTML

<html>
	<body>
		<input id="my-input" />
		<input type="button" onClick="getInputValue()" value="Показать значение" />

  
		<script>
			function getInputValue() {
				var input = document.getElementById("my-input");
				alert(input.value);
			}
		</script>
	</body>
</html>