jQuery selection with dynamic id's

后端 未结 5 1854
余生分开走
余生分开走 2020-12-15 09:56

I have a form that is dynamically generated, and has dynamically generated id\'s (and potentially classes). The forms are the same but they have the related id tacked on to

5条回答
  •  臣服心动
    2020-12-15 10:55

    You can use $("input#id_airline_for" + id) (where id is your number, e.g., 8), but it will be faster if you drop the tag name and just use:

    $("#id_airline_for" + id);
    

提交回复
热议问题