我的 .attr 方法有问题 我想更改我添加的每个选择框的类
详细信息此处
以获取更多 它..?
I have problem with .attr methodI want to change the class of every select box that I added
for more details Here
Anything wrong with it..?
如果我很清楚你必须做什么,这就是麻烦。
//c.children(':text').attr('class','jabatan'+ (++i) ); c.children('select').addClass('jabatan' + (++i));
我认为你的选择器(我评论过的)没有找到任何东西,所以不要添加任何东西,
我希望它有帮助
if I understand well what you have to do, this is the trouble.
I think your selector (that I commented) don't find anything, and so don't add anything
I hope it helps
您是否尝试过使用 removeClass 和 addClass 而不仅仅是 attr ?或者,您是否尝试过直接引用节点并设置 className ($(somenode)[0].className = "somevalue")?
removeClass
addClass
attr
$(somenode)[0].className = "somevalue"
Have you tried using removeClass and addClass instead of just attr? Alternatively, have you tried getting a direct reference to the node and setting className ($(somenode)[0].className = "somevalue")?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(2)
如果我很清楚你必须做什么,这就是麻烦。
我认为你的选择器(我评论过的)没有找到任何东西,所以不要添加任何东西,
我希望它有帮助
if I understand well what you have to do, this is the trouble.
I think your selector (that I commented) don't find anything, and so don't add anything
I hope it helps
您是否尝试过使用
removeClass
和addClass
而不仅仅是attr
?或者,您是否尝试过直接引用节点并设置 className ($(somenode)[0].className = "somevalue"
)?Have you tried using
removeClass
andaddClass
instead of justattr
? Alternatively, have you tried getting a direct reference to the node and setting className ($(somenode)[0].className = "somevalue"
)?