Textarea form 属性
 Textarea 对象
 Textarea 对象
定义和用法
form 属性返回对包含该 text area 的 表单的引用。
若成功,则该属性返回一个 form 对象。
语法
textareaObject.form
浏览器支持





所有主流浏览器都支持 form 属性
实例
实例
本例返回文本域所属的表单的 id:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>代码学院(codexy.cn)</title>
<script>
function displayResult()
{
var x=document.getElementById("myTextarea").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
<textarea id="myTextarea" cols="20">
在代码学院,你可以学多很多编程的基础知识,包括 HTML, XML, SQL, ASP, 和 PHP 等各种前端内容。
</textarea>
</form>
<br>
<button type="button" onclick="displayResult()">显示 form 的 id</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>代码学院(codexy.cn)</title>
<script>
function displayResult()
{
var x=document.getElementById("myTextarea").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
<textarea id="myTextarea" cols="20">
在代码学院,你可以学多很多编程的基础知识,包括 HTML, XML, SQL, ASP, 和 PHP 等各种前端内容。
</textarea>
</form>
<br>
<button type="button" onclick="displayResult()">显示 form 的 id</button>
</body>
</html>
 Textarea 对象
 Textarea 对象			
						
			
 JavaScript 教程
JavaScript 教程 JavaScript 对象
JavaScript 对象 jQuery 教程
jQuery 教程 JSON 教程
JSON 教程 AngularJS 教程
AngularJS 教程 Angular 2 教程
Angular 2 教程 Vue.js 教程
Vue.js 教程 React 教程
React 教程 jQuery UI 教程
jQuery UI 教程 jQuery EasyUI 教程
jQuery EasyUI 教程 AJAX 教程
AJAX 教程 Highcharts 教程
Highcharts 教程 Google Maps API 教程
Google Maps API 教程 ES6 教程
ES6 教程 TypeScript教程
TypeScript教程 ES6 标准入门
ES6 标准入门