Changing name attribute using jQuery

前端 未结 3 2017
梦谈多话
梦谈多话 2020-12-05 23:05

I\'ve got a jQuery function that attempts to change the id, name and class attribute values of an element.

The id

3条回答
  •  长情又很酷
    2020-12-05 23:33

    Instead of chaining you can pass into .attr()

    {
        "id" : "sel" + rowIndex ,
        "name" : "sel" + rowIndex
    }
    

    A lot of jQuery functions accept objects like above when you have to pass in (string comma string) data like .css() and .animate()

提交回复
热议问题