執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> <form> <fieldset id="myFieldset"> <legend>Personalia:</legend> Name: <input type="text"><br> Email: <input type="text"><br> Date of birth: <input type="text"> </fieldset> </form><br> <button onclick="disableField()">Disable fieldset</button> <button onclick="undisableField()">Undisable fieldset</button> <script> function disableField() { document.getElementById("myFieldset").disabled = true; } function undisableField() { document.getElementById("myFieldset").disabled = false; } </script> </body> </html>