propiedades de formulario HTML DOM Textarea
objeto textarea
Definición y Uso
formulario propiedad devuelve el área de texto que contiene la referencia a la forma.
Si tiene éxito, esta propiedad devuelve un objeto de formulario.
gramática
textareaObject.form
Soporte para el navegador
Todos los principales navegadores soportan las propiedades del formulario
Ejemplos
Ejemplos
Este ejemplo devuelve campo de formulario de texto pertenece Identificación:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</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>本教程(w3big.com)</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>
objeto textarea