Extract and set form values through the DOM—no frameworks required! https://github.com/TheoryOfNekomata/formxtra
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122
  1. # get-form-values
  2. Get the value of a form using `HTMLFormElement.elements`.
  3. ## Usage
  4. ```typescript
  5. import getFormValues from '@theoryofnekomata/get-form-values';
  6. const form = document.getElementById('form')
  7. // optional, but just in case there are multiple submit buttons in the form,
  8. // individual submitters can be considered
  9. const submitter = form.querySelector('[type="submit"]')
  10. const values = getFormValues(form, submitter)
  11. ```
  12. ## Tests
  13. The library has been tested on JSDOM through Jest, and the real DOM using
  14. Cypress.