passing dynamic id's to javascript

后端 未结 2 1881
离开以前
离开以前 2021-01-16 11:17

i have a while loop that changes the id of each input field.

   print\"

        
2条回答
  •  不知归路
    2021-01-16 11:41

    Use square bracket notation instead of dot notation.

    foo.bar === foo['bar']
    

    You can pass the string in a variable rather than as a literal.

提交回复
热议问题