tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

button-validity.html (820B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Forms</title>
      5  <script src="/resources/testharness.js"></script>
      6  <script src="/resources/testharnessreport.js"></script>
      7 </head>
      8 <body>
      9  <p>
     10    <h3>button_validity</h3>
     11  </p>
     12 
     13  <hr>
     14 
     15  <div id="log"></div>
     16 
     17  <form method="post"
     18      enctype="application/x-www-form-urlencoded"
     19      action=""
     20      id="input_form">
     21    <p><button id='button_id'>button</button></p>
     22  </form>
     23  <script>
     24 
     25    var button = document.getElementById("button_id");
     26 
     27    if (typeof(button.validity) == "object") {
     28      test(function() {
     29        assert_equals(button.validity.valueMissing, false, "validity attribute is not correct.");
     30      });
     31    } else {
     32      test(function() {
     33        assert_unreached("validity attribute is not exist.");
     34      });
     35    }
     36 
     37  </script>
     38 
     39 </body>
     40 </html>