<html>
<body>
电子邮件:<input type="email" id="myEmail" value="billgates@example.com">
<p>单击该按钮可更改电子邮件字段的默认值。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myEmail").defaultValue = "stevejobs@w3school.com.cn";
}
</script>
</body>
</html>