option-form.html (920B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>HTMLOptionElement.form</title> 4 <link rel=author title="Sergey Alexandrov" href="mailto:splavgm@gmail.com"> 5 <link rel=help href="https://html.spec.whatwg.org/multipage/#dom-option-form"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <form id="form"> 9 <select id="select"> 10 <optgroup id="optgroup"></optgroup> 11 </select> 12 </form> 13 <div id=log></div> 14 15 <script> 16 test(function () { 17 var form = document.getElementById("form"); 18 var select = document.getElementById("select"); 19 var optgroup = document.getElementById("optgroup"); 20 21 var o1 = document.createElement("option"); 22 assert_equals(o1.form, null); 23 24 select.appendChild(o1); 25 assert_equals(o1.form, select.form); 26 27 var o2 = document.createElement("option"); 28 select.appendChild(o2); 29 assert_equals(o2.form, select.form); 30 31 }, "form"); 32 </script>