[native code] means that it is a function built into the browser, not written in JavaScript. tags is a WebKit extension for the DOM so you can get a list of elements in the form by tag name. For example, if I run this on the StackOverflow page, I get the response text area:
document.getElementById('submit-button').form.elements.tags("textarea")[0]
The problem is that the index in the collection in JavaScript also has access to any properties of the object (including methods), so when you try to access the named element tags , instead you get a method on the elements object that WebKit defines. Fortunately, there is a workaround; you can call namedItem on the list of elements to get the id or name element:
var tags = button.form.elements.namedItem("tags").value;
to change . Note that it is probably best to use namedItem in general even in other browsers if you need to get an element named item or length or something like that; otherwise, if you use them as an index with the [] operator, you will get the built-in method item or length instead of your element.
source share