jQuery 如何 根据 value 获得 class_html/css_WEB-ITnose

html教程评论310 views阅读模式

看清楚,不是要类选择器取得value!

好好学习
天天向上

...

是循环显示,的class是循环编号的,现在知道某一个的value 是 '好好学习',请问怎么得到 class ='1'

JS , Jquery 都行

回复讨论(解决方案)

$.each($('tr td'),function(){     if($(this).text()=="天天向上")    {          alert($(this).attr("class"))    }})

$.each($('tr td'),function(){     if($(this).text()=="天天向上")    {          alert($(this).attr("class"))    }})

谢谢大牛,刚才开会去了.

 
 
天天向上 好好学习

 
 
天天向上 好好学习

没分了...

企鹅博客
  • 本文由 发表于 2019年9月21日 04:19:58
  • 转载请务必保留本文链接:https://www.qieseo.com/368332.html

发表评论