使用jquery搜索元素id或类
我有列表视图,其中包括名称,按钮及其有10条记录,当我点击列表视图行上的按钮时,
,
i将其ID更改为$('#add')。removeAttr('id')。attr('id','1');
然后我禁用此按钮
$(this).closest(tr)。find('。add1')。attr(disabled,true)
并将此记录保存在另一个表列表中通过使用克隆方法查看
并将此按钮的类更改为删除
我的问题是假设首先我选择一个名称更改按钮id / class为1并克隆它
然后b名称更改按钮id / class为2,然后是c name然后是3,
如果我删除第二个表的b名称我如何搜索这个名称为id / class为2的名称行为2,禁用为true,我想让它禁用false
我尝试了什么:
i不知道如何搜索bu tton id / class
I have list view which include name ,button and its have 10 records,
when i clicked on button on list view row ,
i changed it's id as $('#add').removeAttr('id').attr('id', '1');
and then i disable this button
$(this).closest("tr").find('.add1').attr("disabled", true)
and save this record in another table list view by using clone method
and change the class of this button as remove
my question is suppose first i select a name change button id/class as 1 and clone it
then b name change button id/class as 2 ,then c name and then 3 ,
if i remove b name of second table how i search this b name row which have id/class is 2 which is disabled true , and i want make it disabled false
What I have tried:
i cant have any idea how to search button id/class
('#add')。removeAttr('id')。attr('id','1');
然后我禁用此按钮
('#add').removeAttr('id').attr('id', '1');
and then i disable this button
(this).closest(tr)。find('。add1')。attr(disabled, true)
并使用clone方法将此记录保存在另一个表列表视图中
并将此按钮的类更改为remove
我的问题是假设首先我选择一个名称更改按钮ID /类为1并克隆它
然后b名称更改按钮ID /类为2,然后是c名称然后是3,
如果我删除第二个表的b名称我如何搜索这个名称为id / class为2的名称行为2是的,我希望禁用它是假的
我尝试过:
i不知道如何搜索按钮id / class
(this).closest("tr").find('.add1').attr("disabled", true)
and save this record in another table list view by using clone method
and change the class of this button as remove
my question is suppose first i select a name change button id/class as 1 and clone it
then b name change button id/class as 2 ,then c name and then 3 ,
if i remove b name of second table how i search this b name row which have id/class is 2 which is disabled true , and i want make it disabled false
What I have tried:
i cant have any idea how to search button id/class