I'm working with the following element
<input type="text" size="4" name="nightly" value="-1">
My goal is to update the value
to 15.9
specifically when name="nightly"
Here's what I've attempted so far:
document.getElementsByName('name')['nightly'].setAttribute('value', '15.9');
But unfortunately, this results in an error message:
TypeError: undefined is not an object (evaluating 'document.getElementsByName('name')['nightly'].setAttribute')