<script type="text/javascript">
window.onload = function () {
document.getElementById("btn").onclick = function () {
alert(document.getElementById("text").value);
}
}
</script>
<input type="text" id="text">
<input type="button" id="btn" value="获取文本框中的内容">
<script type="text/javascript">
window.onload = function () {
document.getElementById("setbtn").onclick = function () {
document.getElementById("username2").value = document.getElementById("username1").value
}
}
</script>
<input type="text" id="username1">
<br>
<input type="text" id="username2">
<br>
<input type="button" value="将第一个文本框上的值复制到第二个文本框上" id="setbtn">
<br>
<input type="text" onblur="alert(this.value+'失去焦点')">
```c++
```