[jQuery]在Firebug下使用jQuery列舉所有連結

有關網頁及相關語法的討論
回覆文章
頭像
tim
文章: 1380
註冊時間: 2008年 11月 26日, 00:49

[jQuery]在Firebug下使用jQuery列舉所有連結

文章 tim »

代碼: 選擇全部

$( "a" ).each(function( index ) {
  //console.log( index + ": " + $(this).text() );
  if($(this).text().indexOf("someword") !=-1){
    console.log(  $(this).attr('href') );
  }
});
多多留言, 整理文章, 把經驗累積下來.....
回覆文章