<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			window.onload = function(){
				var oInp = document.getElementById("inp");
				var oBtn = document.getElementById("btn");
				
				oBtn.onclick = function(){
//					oInp.value = "123123";//用点来实现
//					oInp['value'] = "123213";//用中括号 里面是字符串
					
					oInp.setAttribute('value',"123123");
				}
			}
		</script>
	</head>
	<body>
		<input type="text"  />
		<button >按钮</button>
	</body>
</html>

  

相关文章:

  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2022-02-27
  • 2021-07-21
  • 2021-12-07
  • 2021-12-27
猜你喜欢
  • 2021-12-18
  • 2021-08-15
  • 2021-06-07
  • 2022-12-23
  • 2021-06-18
  • 2021-12-05
  • 2022-12-23
相关资源
相似解决方案