Menu
I created a form using javascript and set the name attribute. When i refer to that form using getElementsByName, it doesn’t work. It can only refer with getElementsByTagName. Any idea why?
[Quote]
var uplform = document.createElement(“form”);
uplform.setAttribute(“action”,”index.php”);
uplform.setAttribute(“method”,”post”);
uplform.setAttribute(“name”,”uplform”);
uplform.setAttribute(“enctype”,”multipart/form-data”);
[Quote]
var frm = document.getElementsByName(“uplform”); //doesn’t work
[Quote]
var frm = document.getElementsByTagName(“uplform”); //works