摘要:
清华大学出版的《事半功倍系列 javascript》,本人照着书敲出来的,有些翻译了一下.前几年看了一下,最近无事,重新翻了翻,很有帮助.本书应该有光盘的,但学校的书,光盘不知在哪.希望对你学 javascript有帮助关键字:
Javascript学习 js 正文:
</form>
<script>
document.write("表单text1类型是: "+document.form1.text1.type+"<br>")
document.write("表单text1名称是: "+document.form1.text1.name+"<br>")
document.write("表单text1值是: "+document.form1.text1.value+"<br>")
document.write("表单text1大小是: "+document.form1.text1.size+"<br>")
</script>
<form name=form1>
<input type=text name=text1 value=click here
onfocus=document.form1.text1.select()>
</form>
2.使用密码框
<form name=form1>
<input type=password name=pw1 value=daylight>
</form>
<script>
document.write("表单pw1的类型:"+document.form1.pw1.type+"<br>")
document.write("表单pw1的名称:"+document.form1.pw1.name+"<br>")
document.write("表单pw1的值:"+document.form1.pw1.value+"<br>")
document.write("表单pw1的大小:"+document.form1.pw1.size+"<br>")
</script>
3.使用隐藏字段
<form name=form1>
<input type=hidden name=hid1 value=piece of eight>
</form>
<script>
document.write("表单hid1的类型:"+document.form1.hid1.type+"<br>")
document.write("表单hid1的名称:"+document.form1.hid1.name+"<br>")
document.write("表单hid1的值:"+document.form1.hid1.value+"<br>")
</script>
4.使用文本区域框
<form name=form1>
<text area name=ta1>how many grains of sand are there in the sahara desert?</text area>
</form>
<script>
document.write("表单ta1的类型:"+document.form1.ta1.type+"<br>")
document.write("表单ta1的名称:"+document.form1.ta1.name+"<br>")
document.write("表单ta1的值:"+document.form1.ta1.value+"<br>")
document.write("表单ta1的横向宽度:"+document.form1.ta1.cols+"<br>")
document.write("表单ta1的纵向宽度:"+document.form1.rows.value+"<br>")
</script>
<form name=form1>
<text area name=ta1 rows=4 onfocus="document.form1.ta1.select()"> how many grains of sand are there in the sahara desert?</text area>
</form>
5.使用按钮
<form name=form1>
<input type=button name=button1 value=标准按钮>
</form>
<script>
document.write("表单button1的类型:"+document.form1.button1.type+"<br>")
document.write("表单button1的名称:"+document.form1.button1.name+"<br>")
document.write("表单button1的值:"+document.form1.button1.value+"<br>")
</script>
<form name
[1][2][3][4][5][6][7][8]