Is it alright to add custom Html attributes?

前端 未结 11 807
醉梦人生
醉梦人生 2020-12-14 02:23

I have a site I\'m working on where I want to mark if a row of data has been changed. If something has been changed in that row I would mark it with a custom attribute like

11条回答
  •  庸人自扰
    2020-12-14 02:39

    Why don't you use the jQuery data capability?

    Your example will be (I don't know the condition to select proper td):

    $("tr td").data("isDirty", true);
    

    take a look at documentation

提交回复
热议问题