I would like to create a .js file that has multiple submit buttons lined up vertically on a page. If you click the 1st one, it will direct you to a page (or stay on the current page but wipe everything clean) that contains a paragraph of text that basically tells you that you clicked the first button. If you click the second button, then it will display a paragraph saying you’ve clicked the second, and so on.
Share
Give all these buttons the same class, then try something like this:
Of course this assumes the buttons will be returned from
getElementsByClasNamein the same order they exist on the page. I think that’s true, but I’m not certain.