Answer the question
In order to leave comments, you need to log in
How to get the names of all forms on the page as an array?
On different pages of the site there are forms with css classes whose names match the regular expression:
js-[a-z-]*-form
For example:
js-signup-form
js-create-product-form
[signup, create-product]
Array.from(document.getElementsByTagName('p')).map((item) => item.innerHTML.replace('...', '...'))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question