document.getElementsByName()
returns a NodeList, so you have to access it by an index: document.getElementsByName('staff_counter')[0]
(depending on how many of these you have).
You also have access to a length
property to check how many Elements were matched.
More Related Contents:
- how to get the base url in javascript
- Javascript does not work
- Force browser to download image files on click
- How can I count text lines inside an DOM element? Can I?
- Event detect when css property changed using Jquery
- How to autosize a textarea using Prototype?
- OnChange event handler for radio button (INPUT type=”radio”) doesn’t work as one value
- Do you need text/javascript specified in your tags?
- Find html label associated with a given input
- Dynamically creating HTML elements using Javascript?
- Programmatically selecting partial text in an input field
- How to get the background color of an HTML element?
- How to silently hide “Image not found” icon when src source image is not found
- forcing web-site to show in landscape mode only
- angularjs to output plain text instead of html
- Getting mouse location in canvas [duplicate]
- How to export html table to excel using javascript
- Selecting multiple from an html select element without using ctrl key
- Call two functions from same onclick [duplicate]
- Anchor tag download attribute not working :Bug in Chrome 35.0.1916.114
- How to add and remove classes in Javascript without jQuery
- What are some methods to debug Javascript inside of a UIWebView?
- Preloading images in HTML
- allowing only alphabets in text box using java script
- Auto Mobile Site Redirect
- minimise the code since I am using the same code only the content in p tags changes and component AccordionHeader header changes
- Copy/Paste from Excel to a web page
- onclick event function in JavaScript
- Cross-Origin resource sharing and file://
- Content of html page changed by jQuery but “View Source” don’t reflect the changes