How to Select any element and change its any property
document.getElementsByName('yourname'); // adding zero means the first one out of all
document.getElementById('yourname'); // there can be only 1 id per page
And to alter any attribute of this element, smiply use setAttribute function.
E.g. to change the value property of an element with Id ‘myelement’, we can use this code:
document.getElementById('myelement').setAttribute("value", "our new value");
The attribute that we’re trying to set can be anything, any randomly generated attribute name too.