The reason you’re seeing that error is because document.getElementsByName
returns a NodeList
of elements. And a NodeList
of elements does not have a .value
property.
Use this instead:
document.getElementsByName("acc")[0].value
More Related Contents:
- jQuery. Find all attribute values within/under elements `script or noscript or iframe` that have attribute keys as `src or href` [closed]
- When I load the page the alert(“hey”) function appears, why does the js function execute despite no onClick call? How do I prevent it from doing so?
- What is the difference between properties and attributes in HTML?
- How to stop event propagation with inline onclick attribute?
- “Submit is not a function” error in JavaScript
- How can I select an element by name with jQuery?
- How to resolve the C:\fakepath?
- How can I simulate a click to an anchor tag?
- Finding line-wraps
- How to get the element clicked (for the whole document)?
- How to Implement DOM Data Binding in JavaScript
- Can I load an entire HTML document into a document fragment in Internet Explorer?
- Getting value of HTML Checkbox from onclick/onchange events
- Get element at specified position – JavaScript
- How to iterate through all attributes in an HTML element?
- Get the DOM path of the clicked
- HTML Table with vertical rows
- How to move table row in jQuery?
- contentDocument for an iframe
- Remove specific HTML tag with its content from javascript string
- Is it the last `script` element the currently running script?
- Get elements from page.evaluate in Puppeteer? [duplicate]
- React, losing saved data in localStorage with useEffect after page refresh
- Getting HTML elements by their attribute names
- How to escape HTML
- User Activity Tracking using javascript library [closed]
- Boolean HTML Attributes
- Is there a way to know if a link/script is still pending or has it failed
- Images failing to load in IE with DOM: 7009 error (unable to decode) in console
- Why is iframe.contentWindow == null?