Frontend/前端_基礎HTML/templates/Demo.html
2024-04-23 18:57:58 +08:00

67 lines
1.1 KiB
HTML

<style>
table {
border-collapse: collapse;
border-spacing: 0px;
}
table,
th,
td {
padding: 5px;
border: 1px solid black;
}
</style>
<body>
<h1>Demo</h1>
<div>
<button onclick="button_click()">123</button>
<br>
<br>
<input id="text_in_id"/>
<button onclick="text_click()">測試按鈕</button>
<input id="text_out_id"/>
<br>
<br>
<br>
<button onclick="alert('這是警告文字');">開啟警告視窗</button>
<br>
<br>
<table>
<tr>
<th>First name</th>
<th>Last name</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
<tr>
<td>Jane</td>
<td>Doe</td>
</tr>
</table>
</div>
</body>
<script>
function button_click() {
console.log('button_click_確認')
}
</script>
<script>
function text_click() {
var in_text = document.getElementById("text_in_id").value
console.log(in_text)
document.getElementById('text_out_id').value = in_text
}
</script>