Home > front end >  JavaScript get elements by class on submit iteration
JavaScript get elements by class on submit iteration

Time:03-27

I'm trying to iterate over forms for likes with flask and AJAX. It works if there is just a single form and I use get element by id. What am I doing wrong in JS while iterating over the class?

HTML:

<form  method="POST">
    <input type="hidden" name="user_id" value="{{session['logged_in']['id']}}">
    <input type="hidden" name="like_id" value="32">
    <input type="submit"  value="           
  • Related