<html>
<meta charset="UTF-8">
<head>
<script>
function show(idx){
var obj = document.getElementById(idx);
alert(obj.value);
}
</script>
</head>
<body>
<input type="text" id="user">
<input type="button" value="click me" onclick="show('user')">
</body>
</html>
转载请注明原文地址: https://www.6miu.com/read-1077.html