将类名添加到属性 [英] add class name to an attribute

查看:72
本文介绍了将类名添加到属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

**i need to add class name to an attribute**
for example  <li tab="tab1"> and i want to add class to to tab1
like mentioned in the below line
$(attribute ).addClass(class );

推荐答案

(属性).addClass (class);
(attribute ).addClass(class );


我认为这就是你要求的:



I think this is what you are asking for:


(''li [tab = tab1]'')。addClass(class);
(''li[tab=tab1]'').addClass(class);





但我不确定你对自己的回答是你找到了解决方案,还是你正在扩展这个问题。



But I''m not sure if your answer to yourself was that you found a solution, or that you are expanding on the question.


这篇关于将类名添加到属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆