$(a).each(function(index、item){var url = $(this).attr( "href"); if(url.indexOf( "/ visit /")!==-1){$( this).attr(“ rel”、“ nofollow”);}});