<html lang="">
<meta charset="utf-8">
<!-- <meta http-equiv="refresh" content="3;http://www.baidu.com"> -->
<meta http-equiv="expires" content="Wen, 22 Mar 2017 2:10:00 GMT">
<body>
<!-- <form action="http://www.baidu.com" id="my" oninvalid="alert()" οninput="res.value = num1.valueAsNumber + num2.valueAsNumber">
<input type="text" name="name">
<input type="submit" value="1">
<input type="text" value="555555555" name="hh" form="my">
<input type="time" name="" id="">
<input type="color" name="color" id="" form="my">
<input type="date" name="date" id="" form="my">
<input type="file" name="" id="" accept="image/gif">
<input type="image" src="https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=3712937641,143648574&fm=80&w=179&h=119&img.JPEG" alt="" form="my">
<input type="number" name="" id="num1"> + <input type="number" name="" id="num2"> = <output for="num1 num2" name="res" />
<input data-name="zc" data-id="002" class="inp"/>
</form> -->
<input type="text" accesskey="h" tabindex="2">
<input type="text" accesskey="h" tabindex="1">
<p contenteditable="true">啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</p>
<p dir="ltr" lang="en" hidden id="h5">HTML5</p>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$(function(){
$('#h5').show();
$('.inp').data('name','tcac');
$('.inp').data('id','0058');
// alert($('.inp').data('name'));
})
</script>
</body>
</html>
参看文章:https://css-tricks.com/form-validation-part-1-constraint-validation-html/