JSFiddle - React, Tailwind, and code Playground
by eget teteete
HTML
<form action="#" name='forms'>
<input type="text" name='text' value='text'>
<input for='check' name='check' type="checkbox" placeholder='checkbox'>
<input type="file" name='file' placeholder='file'>
<input type="password" name='password' value='password'>
<input type="hidden" name='hidden' value='hidden'>
<input type="password" name='password' value='password'>
<input type="radio" name='radio' value='radio'>
<input type="reset" name='reset' value='reset'>
<input type="submit">
</form>
CSS
form {
display: inline-grid;
min-height: 250px;
}
input {
margin: 7.5px;
}
JavaScript
const forms = document.forms;
console.log(forms);
console.log(forms.elements[3]);
console.log(forms.radio);
console.log(forms.length);
for (var i = 0; i < forms.elements.length; i++) {
forms.elements[i].value = 'new text'
}