Get element's ID and set it as variable

前端 未结 6 1472
执笔经年
执笔经年 2020-12-02 02:18

I have a button:

6条回答
  •  有刺的猬
    2020-12-02 02:41

    Try one of the following:

    $(this).attr(example_id, "value")
    

    Or

    window[ currForm.attr(id)] = 12;
    

    Or

    window[ this.id ] = 12;
    

提交回复
热议问题