JS onsubmit onreset事件

<!-- onsubmit事件的事件源是form标签 --> <form action="1.html" method="post"> 用户名:<input type="text" name="username"><br> 密码:<input type="text" name="password"><br&gt...

Read more

JS onselect事件

<textarea name="" id="info" cols="30" rows="10"></textarea> <script type="text/javascript"> // /获取元素 var info = document.getElementById('info'); info.onselect = f...

Read more

JS 城市联动

<select name="" id="province"> <option value="0">北京</option> <option value="1">河南</option> <option value="2">河北</option> ...

Read more

JS onchange事件

<select name="" id="yinliao"> <option value="0">白开水</option> <option value="1">矿泉水</option> <option value="2">白酒</option> <option value...

Read more

JS 焦点事件

input{ width:200px; height:20px; border:solid 1px #ddd; } <input type="text" /> <input type="text" /> <input type="text" /> <input type="text" id="username" /&...

Read more

JS 拖动div效果

<style> * { margin:0px; padding:0px; } #move { width:200px; height:200px; background:orange; position:absolute; } </style> <div id="move"></div...

Read more

JS 鼠标按下 onmousedown onmouseup

<div style="width:300px;height:300px;background:#456"></div> var div = document.getElementsByTagName('div')[0]; //绑定事件 div.onmousedown = function() { alert('鼠标被按下了啊!!!'); } d...

Read more