题解 | #表单类型#
表单类型
https://www.nowcoder.com/practice/1005654d20fe4e0d97982363d4f55202
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style></style> </head> <body> <form> <!-- 补全代码 --> <input type="password" value="nowcoder" /> <input type="checkbox" checked /> </form> <script type="text/javascript"> // 填写JavaScript </script> </body> </html>
注意:题目是说默认值,不是说提示性文字,所以要用value,不能用placeholder
密码类型:password
复选框类型:checkbox,选中状态就是添加 checked = 'checked',可简写checked