- 主题:问一个jquery问题
一个页面包含多个:<span>数字</span>
判断包含的数字不为0的,给设置红色,怎么写。
--
FROM 223.72.68.*
$('span').each(function(){$.trim($(this).html())!=='0' && $(this).css('color','red')});
--
FROM 118.186.252.*
正常的写法是渲染的时候为span加样式
【 在 ay1208 的大作中提到: 】
: 一个页面包含多个:<span>数字</span>
: 判断包含的数字不为0的,给设置红色,怎么写。
: --
: ...................
--来自微水木3.2.0
--
FROM 182.97.159.*
伪代码
$("span").each(function(index){
if( isnotnumber($(this).text())){
$(this).css( "color", "red" );
}
});
【 在 ay1208 的大作中提到: 】
: 一个页面包含多个:<span>数字</span>
: 判断包含的数字不为0的,给设置红色,怎么写。
:
--
FROM 124.207.72.*