码迷,mamicode.com
首页 > 编程语言 > 详细

常见的JavaScript代码(四)

时间:2015-02-16 22:14:30      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:javascript

文章来自“PHP100中文网”


18.改变按钮的图片.
<style type="text/css">
<!--
.style3 { font-size: 12px; background: url(image/buttonbg1.gif); border: 0px; width: 60px; height: 22px}
.style4 { font-size: 12px; font-weight: bold; background: url(image/buttonbg2.gif); border: 0px 0; width:

60px; height: 22px}
-->
</style>
  本例的按钮代码如下:
<input type="submit" name="Submit2" value="提 交" onmouseover="this.className=‘style4‘"

onmouseout="this.className=‘style3‘" class="style3">

19.打印页面
<div align="center"><a class=content href="javascript:doPrint();">打印本稿</a></div>

20.可以直接写html语言
document.write("");

21.改变下拉框的颜色
<select name="classid"

onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)"

size="1" style="color:#008080;font-size: 9pt">

22.转至目标URL
window.location="http://guoguo"

23.传递该object的form
UpdateSN(‘guoqiang99267‘,this.form)
function UpdateSN(strValue,strForm)
{
strForm.SignInName.value = strValue;
return false;
}

24.文字标签
<label for="AltName4"><input name="AltName" type="RADIO" tabindex="931" id="AltName4"

>guoqiang99859</label>

25.layer2为组件的ID,可以控制组件是否可见
document.all.item(‘Layer2‘).style.display = "block";
document.all.item(‘Layer2‘).style.display = "none";//

26.将页面加入favorite中
<script language=javascript>
<!--
function Addme(){
url = "http://your.site.address"; //你自己的主页地址
title = "Your Site Name"; //你自己的主页名称
window.external.AddFavorite(url,title);
-->
</script>//

27.过10秒自动关闭页面
< script language="JavaScript" >
function closeit() {
setTimeout("self.close()",10000)
}
< /script >

常见的JavaScript代码(四)

标签:javascript

原文地址:http://blog.csdn.net/hyf93924/article/details/43854417

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!