0
Form attribute
I am wondering, about the name and id attribute in the form element. We can have the name attribute with same value to the many element but id attribute value should be unique to each element. But this is not my doubt . My doubt is , When I have a forms like 1. <form name="myForm" onsubmit=return false></form> 2. <form name="myForm" id="newId" onsubmit=return false></form 3. <form name="myForm" id="myForm" onsubmit=return false></form From all the above forms if I fire the submit event in the document object like document.myForm.submit() This submit action will trigger if I give the form element like 3rd . Why 1st and 2nd is not working though it has myForm as a name attribute in it. Please help me to understand it better.
3 Answers
0
Code ,
I'm sorry I won't answer your HTML question in full (I'm too into Python these days), but I will point you to my favorite HTML reference, w3schools. The navigation is a little unexpected, but once you grok it, you'll find (almost) everything about HYML documented there. Here's the page on the <form> tag.
https://www.w3schools.com/tags/tag_form.asp
0
Thanks Rain for taking time to answer my question. But I don't think I can find the solution to my questions in w3school.
0
Code ,
But that page explains the <form> tag!