JS代码
上一篇 /
下一篇 2016-05-18 21:27:24
/ 个人分类:JS
- 1.文本框焦点问题onBlur:当失去输入焦点后产生该事件onFocus:当输入获得焦点后,产生该文件Onchange:当文字值改变时,产生该事件Onselect:当文字加亮后,产生该文件
- <inputtypeinputtype="text" value="mm" onfocus="if(value=='mm) {value=''}" onblur="if(value=='') {value='mm'}">点击时文字消失,失去焦点时文字再出现
- 2.网页按钮的特殊颜色
- <inputtypeinputtype=buttonname="Submit1" value="郭强" size=10class=s02style="background-color:rgb(235,207,22)">
- 3.鼠标移入移出时颜色变化
- <inputtypeinputtype="submit" value="找吧" name="B1" onMouseOut=this.style.color="blue"onMouseOver=this.style.color="red"class="button">
- 4.平面按钮
- <inputtypeinputtype=submitvalue=订阅style="border:1px solid :#666666; height:17px; width:25pt; font-size:9pt;BACKGROUND-COLOR: #E8E8FF; color:#666666" name="submit">
- 5.按钮颜色变化
- <inputtypeinputtype=textname="nick" style="border:1px solid #666666; font-size:9pt; height:17px;BACKGROUND-COLOR: #F4F4FF; color:#ff6600" size="15" maxlength="16">
- 6.平面输入框
- <inputtypeinputtype="text" name="T1" size="20" style="border-style.: solid; border-width: 1">
- 7.使窗口变成指定的大小
- <script>window.resizeTo(300,283);</script>
- 8.使文字上下滚动<marqueedirectionmarqueedirection=upscrollamount=1scrolldelay=100onmouseover='this.stop()'onmouseout='this.start()'height=60><tr><td>共和国</table></marquee>
- 9.状态栏显示该页状态
- <baseonmouseoverbaseonmouseover="window.status='网站建设 http://www.webmake.cn/' ;return true">
- 10.可以点击文字实现radio选项的选定
- <br> <inputtypeinputtype="radio" name="regtype" value="A03" id="A03"><labelforlabelfor="A03"> 情侣 : 一次注册两个帐户</label><br>
- 11.可以在文字域的font写onclick事件
- 12.打印</a>打印网页
- <ahrefahref='javascript.:window.print()'>
- 13.线型输入框
- <inputtypeinputtype="text" name="key" size="12" value="关键字" onFocus=this.select()onMouseOver=this.focus()class="line">
- 14.显示文档最后修改日期
- <scriptlanguagescriptlanguage=javascript>function hi(str){ document.write(document.lastModified) alert("hi"+str+"!")}</script>
- 15.可以在鼠标移到文字上时就触发事件
- <html><head><scriptlanguagescriptlanguage="LiveScript"><!-- Hiding function hello() { alert("哈罗!"); }</script></head><body><ahrefahref="" onMouseOver="hello()">link</a></body></html>
- 16.可以根据网页上的选项来确定页面颜色
- <HTML><HEAD><TITLE>background.html</TITLE></HEAD><SCRIPT></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>
- 17.将按钮的特征改变
- <styletype
收藏
举报
TAG:
标题搜索
日历
|
日 |
一 |
二 |
三 |
四 |
五 |
六 |
| 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | | | | |
数据统计
- 访问量: 3122
- 日志数: 7
- 建立时间: 2015-08-29
- 更新时间: 2016-05-18