HTML DOM Soumettre les propriétés du formulaire
Définition et utilisation
forme propriété renvoie le bouton de confirmation sur le formulaire qui contient des références.
En cas de succès, la propriété renvoie un objet de formulaire.
grammaire
submitObject.form
support du navigateur
Tous les principaux navigateurs prennent en charge les propriétés du formulaire
Exemples
Exemples
L'exemple suivant retourne le formulaire au bouton de confirmation appartient id:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Script>
fonction displayResult () {
var x = document.getElementById ( "Submit1") form.id .;
alerte (x);
}
</ Script>
</ Head>
<Body>
<Form id = "form1">
Email: <input type = "text" id = "email">
<Input type = "submit" id = "Submit1">
</ Form>
<Bouton type = "button" onclick = "displayResult ()"> Affichage formulaire correspondant ID </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Script>
fonction displayResult () {
var x = document.getElementById ( "Submit1") form.id .;
alerte (x);
}
</ Script>
</ Head>
<Body>
<Form id = "form1">
Email: <input type = "text" id = "email">
<Input type = "submit" id = "Submit1">
</ Form>
<Bouton type = "button" onclick = "displayResult ()"> Affichage formulaire correspondant ID </ button>
</ Body>
</ Html>
Essayez »
Soumettre des objets