1表單提交方式
<form>
.....
<input type = "submit"/>
</form>
- 使用
button提交表單
-代碼
function form1() {
//獲取from
var form1 = document.getElementById("form1");
//設(shè)置action
form1.action = "hellow.html";
//提交form表單
form1.submit();
- 使用超鏈接提交
-代碼
<a href="hellow.html?username = 123456">使用超鏈接提交</a>
onclick鼠標(biāo)點(diǎn)擊事件
onchange改變內(nèi)容(一般和select一起使用)
onfocus得到焦點(diǎn)
onclur失去焦點(diǎn)
-代碼
<input type="text" id="input1" name = "text1"value="please input" onfocus="focus1()" onblur="blur1()"/>
</body>
<script type="text/javascript">
function focus1() {
// alert("foucus.")
var input1 = document.getElementById("input1");
input1.value ="";
}
function blur1() {
// alert("blur.")
var input1 = document.getElementById("input1");
input1.value = "please input";
}
2.xml的語(yǔ)法
1.xml的文檔聲明
- 創(chuàng)建一個(gè)文件 后綴名.xml
- 如果寫(xiě)xml,第一步必須寫(xiě)一個(gè)文檔聲明 (寫(xiě)了文檔聲明之后,表示xml文件的內(nèi)容)
- <?xml version="1.0" encoding = gdk?>version
2.定義元素
3.定義屬性
4.注釋
5.特殊字符
6.CDATA區(qū)(了解)
7.PI指令(了解)