JavaScript 基本類 變數物件重新指定
使用時機:
當你的物件在很深的地方。
例如: document.test1.test12.mytest
基本用法:
var mytext = document.test1.test12.mytest;
用法:
<script type="text/javascript">
function myMsg(){
var mytextObj = document.myForm.mytext;
alert("訊息: " + mytextObj.value);
}
</script>
<body>
<form name="myForm">
<input type="text" name="mytext" >
</form>
<input type="button" name="mybutton" value="送出" onclick="myMsg()">
</body>
結果:
- 首頁
- JAVA 目錄
- JAVA WEB 目錄
- JAVA 其他未分類 目錄
- Grails目錄
- jQuery 目錄
- Apache 目錄
- JavaScript 目錄
- Spring + Hibernate 目錄
- Hibernate 目錄
- Linux 目錄
- 程式開發工具目錄
- MySQL 目錄
- PHP目錄
- C/C++ 目錄
- Google App Engine 目錄
- HTML5/CSS3
- 程式開發基本資訊
- Android
- Oracle 目錄
- Struts 目錄