<!--创建图像按钮:使用<input>标记,并且将type属性设置为image,同时可以加入src属性-->
<!--fieldset标记将多个元素分组到一个域容器中,legend标记用来标注域容器-->
<fieldset>
<legend>NameField</legend>
<label>image button:<input type="image" name="imagebutton" src="dudubase/images/arrow_down.png"></label>
<input type="hidden" name="date" value="Augest,2005"/>
<!--select标记:size属性指定可见的列表,第一个selected属性的<option>标记所对应的选项,在该列表初始显示时将被选中,
如果由若干个<option>标记包含了selected属性,那么最后一个包含了selected属性的<option>标记在初始化时被选中,
<select>标记可以包含multiple属性,运行用户多项选择,为了多选,需要按ctl或shift,如果包含multple,那么任何<option>可以包含selected属性
-->
<select name="view" size="2">
<option>theater</option>
<option selected>drive-in</option>
<option>television</option>
</select>
</fieldset>
<!--使用tabindex属性控制Tab键的次序,tabindex可以用于button,input,select和textarea标记中-->
<!--通过disabled属性可以使表单元素失效-->
<!--URL编码:URL和表单数据传递到服务器时,它是经过编码处理的,当URL编码时,空格被转换为加号(+),
其他可能引起问题的字符用一个百分号(%)跟随一个16进制的ASCII指来标识,这告诉浏览器将该字符替换为特点的符号
&:(%26);?:(%3F);%:(%25);":(%22);数字符号:(%23);@:(%40);:号:(%3A);=:(%3D);
URL编码将URL表示成服务器可以识别并且容易解释的一种形式
-->
</form>
</pre>
<pre>
javaScript example
<!--JavaScript是大小写敏感的-->
<!--使用cookie,document.cookie对象-->
<script language="javascript>
if(navigator.appName.indexOf("Microsoft")!=-1)
{
document.write("you are using microsoft innternnet eploree brower");
}
else if(navigator.appName.indexof("Netscape")!=-1)
{
document.write("you are using Netscape's communicator brower");
}
function makeCookie()
{
if(!cookie)
{
Name = prompt("please enter your name");
document.cookie="Name" + Name + ",";
NameStart = document.cookie.indexOf("=");
NameEnd = document.cookie.indexOf(";");
document.write("hello" +
document.cookie.substring(NameStart + NameEnd));
}
}
</script>
<!--产生随机数-->
<script language=""javasript>
QuoteArray=new Array(
"neither can I",
"so you thought about it",
"yes,I have",
"I am glad",
"you had realizee that",
"I come to that conciusioon");
RandomNo=Math.floor(QuoteArray.length*Math.random());
document.write("<b>"+QuoteArray[RandomNo]+"</b>");
</script>
<!--document.write函数可以将文本输出到浏览器-->
<script language="javascript">
document.write('<h1>Welcome to here</h1>');
</script>
<a href="http://news.sohu.com">link#1</a>
<form name="form1">
<!--在浏览器窗口状态栏上显示文本-->
<input type="button" name="statusTxt" value="status text"
onclick="window.status='welcome to the here';"/>
<!--打开一个新的窗口,通过window.open()函数实现,-->
<input type="button" name="openwnd" value="open window"
onclick="window.open('a.html','a',width='200',height='400');"/>
<input type="button" name="closewnd" value="close window"
onclick="window.close();"/>
<!--使用对话框-->
<input type="button" name="alert" value="alert"
onclick="window.alert('welcome');"/>
<input type="button" name="confirm" value="confirm"
onclick="window.confirm('welcome');"/>
<input type="button" name="prompt" value="prompt"
onclick="window.prompt('welcome','hailen');"/>
use String object
<input type="button" name="Stringbtn" value="String object"
onclick="document.form1.dateText.value=document.form1.text2.value.toUpperCase();"/>
use Date object
<input type="text" na