Extract and set form values through the DOM—no frameworks required! https://github.com/TheoryOfNekomata/formxtra
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

README.md 651 B

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