HTML DOM właściwości formularza resetowania
Definicja i Wykorzystanie
Obiekt forma powróci przycisk reset na formularzu, który zawiera odwołania.
Jeśli się powiedzie, właściwość zwraca obiekt formularza.
gramatyka
resetObject.form
Pomoc Browser
Wszystkie główne przeglądarki obsługują właściwości formularza
Przykłady
Przykłady
Wyświetlacz reset do formularza id:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
var x=document.getElementById("reset1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
Email: <input type="text" id="email">
<input type="reset" id="reset1">
</form>
<button type="button" onclick="displayResult()">显示所属的表单ID</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function displayResult(){
var x=document.getElementById("reset1").form.id;
alert(x);
}
</script>
</head>
<body>
<form id="form1">
Email: <input type="text" id="email">
<input type="reset" id="reset1">
</form>
<button type="button" onclick="displayResult()">显示所属的表单ID</button>
</body>
</html>
Spróbuj »
Resetowanie obiekty