好好学习
天天向上
...
是循环显示, 的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")) }}) 谢谢大牛,刚才开会去了.
天天向上 好好学习 alert($("td:contains('好好学习')").attr("class"));
天天向上 好好学习 alert($("td:contains('好好学习')").attr("class")); 没分了...
查看更多关于jQuery如何根据value获得class_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did108700