<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>
JaveScrip基础
最新推荐文章于 2022-04-16 18:12:48 发布