Is there any proper way to reuse Id's?

后端 未结 3 1362
广开言路
广开言路 2021-01-28 07:50

I have a \"create\" form inside a bootstrap\'s modal. All my Javascript related with that form uses id\'s and not class

3条回答
  •  情话喂你
    2021-01-28 08:34

    No, there is no proper way to ever duplicate the use of id's. Browser behavior for this is a mixed bag and cannot be relied on.

    Use classes instead or create dynamic id's for each form.

提交回复
热议问题