首页 > 代码库 > HTML中type的可用类型

HTML中type的可用类型

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"><title>Insert title here</title></head><body><form >账户 : <input type = "text"  name ="user"  size="10"><p>密码 : <input type = "password"  name ="password"  size="10"><p>性别:<input type = "radio"  name = "sex"  value = "man" ><input type = "radio"  name = "sex"  value = "women"><p>  <!--通过name这个属性标示是同一组按钮,但value就表示值不同-->爱好: <input type = "checkbox"  name = "aihao1"  value = "ai">旅游     <input type = "checkbox"  name = "aihao2" value = "book">看书     <input type = "checkbox"  name = "aihao3" value = "ty" >体育<p>你最喜欢的一句话 :     <input type = "text"  name = "mingyan" ><p>     <input type = "submit"  name = "submit" >     <input type = "reset"  name = "reset" ><p>         <input type = "hidden"  name = "hidden" value = "A"><p>        hidden 隐藏域,用户不可见元素。把A传过去但在页面看不到 </form></body></html>

 


 

注意:type =""分号中间的类型不能带空格。如 type ="chckbox  " , chckbox后面连着两个空格,这个会导致错误,可能会导致出现的是文本框

还有两种类型没有写,因为不熟悉

image 图片按钮,可以指定图片背景作为button face;

file 文件选择;搜索

HTML中type的可用类型