JS code gets the name of the form where the list box (select) is located

From , 5 Years ago, written in JavaScript, viewed 68 times.
URL https://pastebin.vip/view/53253027
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <form id="myForm">
  6. <select id="mySelect">
  7.   <option>Apple</option>
  8.   <option>Pear</option>
  9.   <option>Banana</option>
  10.   <option>Orange</option>
  11. </select>
  12. </form>
  13.  
  14. <p>The id of the form is:
  15. <script>
  16. document.write(document.getElementById("mySelect").form.id);
  17. </script>
  18. </p>
  19.  
  20. </body>
  21. </html>
  22.  
  23. //javascript/7973

Reply to "JS code gets the name of the form where the list box (select) is located"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website