為什么那個value="1"不能寫成value="男"?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>單選框、復選框</title>
</head>
<body>
<form action="save.php" method="post" >
? ? <label>性別:</label>
? ? <label>男</label>
? ? <input type="radio" value="1" ?name="gender" />
? ? <label>女</label>
? ? <input type="radio" value="2" ?name="gender" />
</form>
</body>
</html>
為什么那個value="1"不能寫成value="男"?
2015-05-22
在實際開發中,value中的內容是要和后臺進行交互的,一般不采用在value中寫中文,可能會出現亂碼的情況。
在這節當中,只是練習使用的,如果你的網頁是靜態頁面的話,你可以寫成中文