JS代码

上一篇 / 下一篇  2016-05-18 21:27:24 / 个人分类:JS

  1. 1.文本框焦点问题onBlur:当失去输入焦点后产生该事件onFocus:当输入获得焦点后,产生该文件Onchange:当文字值改变时,产生该事件Onselect:当文字加亮后,产生该文件
  2. <inputtypeinputtype="text" value="mm" onfocus="if(value=='mm) {value=''}" onblur="if(value=='') {value='mm'}">点击时文字消失,失去焦点时文字再出现  
  3. 2.网页按钮的特殊颜色
  4. <inputtypeinputtype=buttonname="Submit1" value="郭强" size=10class=s02style="background-color:rgb(235,207,22)">  
  5. 3.鼠标移入移出时颜色变化
  6. <inputtypeinputtype="submit" value="找吧" name="B1" onMouseOut=this.style.color="blue"onMouseOver=this.style.color="red"class="button">
  7. 4.平面按钮
  8. <inputtypeinputtype=submitvalue=订阅style="border:1px solid :#666666; height:17px; width:25pt; font-size:9pt;BACKGROUND-COLOR: #E8E8FF; color:#666666" name="submit">  
  9. 5.按钮颜色变化
  10. <inputtypeinputtype=textname="nick" style="border:1px solid #666666; font-size:9pt; height:17px;BACKGROUND-COLOR: #F4F4FF; color:#ff6600" size="15" maxlength="16">  
  11. 6.平面输入框
  12. <inputtypeinputtype="text" name="T1" size="20" style="border-style.: solid; border-width: 1">  
  13. 7.使窗口变成指定的大小
  14. <script>window.resizeTo(300,283);</script>  
  15. 8.使文字上下滚动<marqueedirectionmarqueedirection=upscrollamount=1scrolldelay=100onmouseover='this.stop()'onmouseout='this.start()'height=60><!-- head_scrolltext --><tr><td>共和国</table><!-- end head_scrolltext--></marquee>  
  16. 9.状态栏显示该页状态
  17. <baseonmouseoverbaseonmouseover="window.status='网站建设 http://www.webmake.cn/' ;return true">  
  18. 10.可以点击文字实现radio选项的选定
  19. <br>    <inputtypeinputtype="radio" name="regtype" value="A03" id="A03"><labelforlabelfor="A03"> 情侣 : 一次注册两个帐户</label><br>  
  20. 11.可以在文字域的font写onclick事件  
  21. 12.打印</a>打印网页
  22. <ahrefahref='javascript.:window.print()'>  
  23. 13.线型输入框
  24. <inputtypeinputtype="text" name="key" size="12" value="关键字" onFocus=this.select()onMouseOver=this.focus()class="line">  
  25. 14.显示文档最后修改日期
  26. <scriptlanguagescriptlanguage=javascript>function hi(str){ document.write(document.lastModified) alert("hi"+str+"!")}</script>  
  27. 15.可以在鼠标移到文字上时就触发事件
  28. <html><head><scriptlanguagescriptlanguage="LiveScript"><!-- Hiding function hello() { alert("哈罗!"); }</script></head><body><ahrefahref="" onMouseOver="hello()">link</a></body></html>  
  29. 16.可以根据网页上的选项来确定页面颜色
  30. <HTML><HEAD><TITLE>background.html</TITLE></HEAD><SCRIPT><!--function bgChange(selObj) { newColor = selObj.options[selObj.selectedIndex].text; document.bgColor= newColor; selObj.selectedIndex=-1; }//--></SCRIPT><BODYSTYLEBODYSTYLE="font-family:Arial"><B>Changing Background Colors</B><BR><FORM><SELECTSIZESELECTSIZE="8" onChange="bgChange(this);"><OPTION>Red<OPTION>Orange<OPTION>Yellow<OPTION>Green<OPTION>Blue<OPTION>Indigo<OPTION>Violet<OPTION>White<OPTION>pink</SELECT></FORM></BODY></HTML>  
  31. 17.将按钮的特征改变
  32. <styletype

TAG:

 

评分:0

我来说两句

日历

« 2024-04-22  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 3122
  • 日志数: 7
  • 建立时间: 2015-08-29
  • 更新时间: 2016-05-18

RSS订阅

Open Toolbar