TheoryOfNekomata c0d6405873 | 3 anos atrás | |
---|---|---|
cypress | 3 anos atrás | |
src | 3 anos atrás | |
test | 3 anos atrás | |
.gitignore | 3 anos atrás | |
LICENSE | 3 anos atrás | |
README.md | 3 anos atrás | |
cypress.json | 3 anos atrás | |
jest.config.js | 3 anos atrás | |
package.json | 3 anos atrás | |
tsconfig.json | 3 anos atrás | |
yarn.lock | 3 anos atrás |
Get the value of a form using HTMLFormElement.elements
.
import getFormValues from '@theoryofnekomata/get-form-values';
const form = document.getElementById('form')
// optional, but just in case there are multiple submit buttons in the form,
// individual submitters can be considered
const submitter = form.querySelector('[type="submit"]')
const values = getFormValues(form, submitter)
The library has been tested on JSDOM through Jest, and the real DOM using Cypress.