Mesak 當前離線
新手上路
$('img').each(function(i,obj){ if( $(obj).attr('alt') != 'Error' ){ $(obj).css({'width':'100px'}) }else{ $(obj).hide() } })
TOP
$('img') // 取得 IMG TAG each //跑回圈 function i,obj //I 是INDEX OBJ 是目前物件 $(obj).attr('alt') 取得該物件的 ALT 屬性
$(function(){ $('img').each(function(a,obj){ if( $(obj).attr('alt') !== 'Error' ){ $(obj).attr('alt','ok') }else{ $(obj).hide() } }) })
$('img').ready(function(){ if( $(this).attr('alt') !== 'Error' ){ $(this).attr('alt') = 'ok' }else{ $(this).hide() } })
$('img').each(function(i,obj)( $(obj).ready(function(){ if( $(this).attr('alt') !== 'Error' ){ $(this).attr('alt') = 'ok' }else{ $(this).hide() } }) })