jQuery: Adding two attributes via the .attr(); method

前端 未结 6 2061
庸人自扰
庸人自扰 2020-12-07 12:35

EDIT:

I learned that using other value than _blank, DOES NOT work on mobile browsers to open new windows/tabs.

For example, if

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 13:35

    Something like this:

    $(myObj).attr({"data-test-1": num1, "data-test-2": num2});
    

提交回复
热议问题