第一課js筆記

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')" />
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章