1.js仍然是在html css基础上的 只是在其中加上了 <script></script>
2.(搜索框)<input type="checkbox" />
(旁边的提示框)(万能) <div></div>
(可在上面的 <style>
#div1{ width: height: ; background: border: }
</style>设置div)(style设置在head之间)(要用background而不是color)
(鼠标移动到input身上时 让div显示 display:block;):
(鼠标移出input身上时 让div隐藏 display:none;)
(onmouseover 事件:会在鼠标指针移动到指定的对象上时发生)
(onmouseout事件:当鼠标指针移动到图像之外时执行一段 JavaScript)
所以自然可以 <input type="checkbox" onmouseover="div1.style.display='block';"
<div id="div1" >xxxx</div>(自然上面的style有关于div的其它描述)(鼠标靠近时提示框按一定的要求出现 )
<input type="checkbox" onmouseout="div1.style.display='none';">(提示框消失)
3.(按钮)<input type="button" value="按钮" />
(按按钮弹出警告框)<input type="button" value="按钮" onclick="alert('xxx')" />
第一课js笔记
最新推荐文章于 2025-07-16 14:37:42 发布