Base-Jsp-2-HTML参考[3]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

me="dateText" size="80">
 <input type="button" name="DateBtn" value="get date"
 onclick="cDate=new Date();document.form1.dateText.value=cDate.toLocaleString();"/>
 use Math object
 <input type="button" name="MathBtn" value="use Math"
 onclick="document.form1.dateText.value=6*Math.PI;"/>
 double click this button
 <input type="button" name="button1" value="Hello"
 onclick="document.form1.button1.value='ok';"
 ondblclick="document.form1.button1.value='good';"/>
 <input type="button" value="start" ondblclick="document.write('Hai')"/>
 
 onkeypress event,press 'd'
 <input type="text" name="text1" value="try"
 onkeypress="if (window.event.keyCode=='100')
 document.form1.text1.value='you pressed the dkey';"/>
 
 focus event
 <input type="text" name="text2" value="interesting"
 onfocus="document.form1.text2.value='look at';"
 onblur="document.form1.text2.value='the focus is gone.';"/>
 
 onchange event
 <select name="select" size="4"
 onchange="document.form1.text3.value='it is there';">
  <option>rasoerry</option>
  <option>chocolate</option>
  <option>pralines</option>
  <option>strawberry</option>
 </select>
 <input type="text" name="text3" value="wait"/>
 
 location object
 <input type="text" name="textloc" size="80">
 <input type="button" name="btnloc" value="location"
 onclick="document.form1.textloc.value=window.location;"/>
 history object
 <input type="button" name="history" value="history"
 onclick="window.history.back();"/>
 links object
 <input type="button" value="change link"
 onclick="document.links[0].href='http://www.microsoft.com';"/>
</form>
move mouse under this picture
<img name="img1" width="300" height="200" src="dudubase/images/2.jpg" onmouseover="document.img1.src='dudubase/images/3.jpg';"
onmouseout="document.img1.src='dudubase/images/4.jpg';"/>

invoke method
<script type="text/javascript">
 function changebg()
 {
  alert("ha ha");
 }
</script>
 <input type="button" name="button5" value="Hello"
 onclick="changebg();"/>
<!--可以将脚本文件放在一个单独的文件中,用法:<script type="text/javascript" src="">--> 
<!--
文档对象模型是用来引用一个网页上所有不同的元素的一种结构
父对象是window,window对象包括处理浏览器窗口的各种对象。
document对象是window的子对象,document对象包括组成网页的所有元素
location对象是window的子对象,它标识了目前网页的URL,它包括一个reload()方法,可用来重载当前的网页
history对象能够复制浏览器的“前进”和“后退”按钮,以实现在已经查看的网页之间切换,
history对象包含,back()方法使前一个装载的网页呈现在浏览器
forward()方法显示下一个网页,go()方法可带一个数字参数,可正可负,能向前或向后浏览历史列表中的网页,document.history.go(-2)
links对象保存了包含在网页上的所有链接
-->
</pre>
<pre>
midea example
<a href="dudubase/images/Trumpet1.wav">Trumpet1.wav</a>
<object data="dudubase/images/Trumpet1.wav" type="audio/wav">
play sound with object
</object>
<!--添加背景音乐,bgsound标记,该标记只在IE下有效,将loop属性设为infinite,背景乐将无限循环,直到点击浏览器“停止”按钮-->
<!--bgsound src="dudubase/images/NBOOK_01.MID" loop="2"/-->

<a href="dudubase/images/8gamma.avi">8gamma.avi</a>
<object data="dudubase/images/8gamma.avi" type="video/avi">
play avi with object
</object>
</pre>

本文关键:Base-Jsp-2-HTML参考
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top