Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Dunno why "am not i am" delete his/her answer, it is mostly correct. The <a href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-63239895" rel="nofollow">form</a> <strong>property</strong> is specified in the DOM 2 HTML spec as readonly and references the form that a form control is in. If it isn't in a form, it will be undefined.</p> <p>The form <a href="http://dev.w3.org/html5/spec/single-page.html#attr-fae-form" rel="nofollow"><strong>attribute</strong></a> is new in HTML5 and is intended to associate a control with a form other than the one it is in. This is intended to be used for nested forms.</p> <p>Setting a form attribute on an input element may have unpredictable results. In browsers conforming to HTML5, if the value of the form attribute is the ID of another form in the document, the control will be associated with that form so its form property is a reference to the form and its form attribute will be a string (the ID of the associated form). Otherwise, the attribute value will not be reflected in the control's form DOM property but may keep the attribute value as set.</p> <p>IE has always messed up attributes and properties, IE 6 replaces the form property with the attribute value regardless. Maybe later versions behave differently, perhaps one of them supports HTML5.</p> <p>The following may help:</p> <pre><code>&lt;form id="form0"&gt; &lt;div&gt; &lt;input type="button" form="form1" onclick= "alert('form property is: ' + this.form + ' ' + this.form.id + '\nform attribute: ' + (typeof this.getAttribute('form')) + ' ' + this.getAttribute('form')) " value="Show form property and attribute"&gt; &lt;/div&gt; &lt;/form&gt; &lt;form id="form1"&gt;&lt;div&gt;&lt;/div&gt;&lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload