代码如下
-----------------------------------------------------------------------------------------------------------------
<html>
<head>
<title>test</title>
<script language="javascript">
function test(){
var str= 'aaaaa'+ document.form1.tel.value;
document.form1.tel2.value = str;
}
</script>
</head>
<body>
<form name="form1">
<input type="text" name="tel" onKeyUp="test()"/>
<input type="text" name="tel2"/>
</form>
</body>
</html>
博客展示了一段代码,运用JavaScript实现功能。在HTML页面中,当用户在一个输入框输入内容时,通过onKeyUp事件触发test函数,该函数将固定字符串与输入框内容拼接后,显示在另一个输入框中。
1807

被折叠的 条评论
为什么被折叠?



