HTML5比较实用的代码

增强IE兼容性

<!--[if IE]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->

HTML5输入类型

<input type="search">



<input type="tel">



<input type="url">



<input type="email">



<input type="datetime">



<input type="date">



<input type="month">



<input type="week">



<input type="time">



<input type="datetime-local">



<input type="number">



<input type="range">



<input type="color">

 

表单验证:

<input type="email" placeholder="[email protected]" pattern="[0-9][A-Z]{3}" required>

 

你可能感兴趣的:(html5)