2014-08-28 43 views

回答

0

试试这个:

$("span[itemprop='employmentType']").each(function(){ 
if($(this).text()=='Third Party Jobs') 
{ 
    $(this).addClass("wpjb-job-apply"); 
} 
}); 

OR

$("span[itemprop='employmentType']").each(function(){ 
if($(this).text()=='Third Party Jobs') 
{ 
    $(this).css('display','none'); 
} 
}); 

CSS:

.wpjb-job-apply{ 
    display:none; 
} 
+0

如果(有此文字)第三方职位添加显示:none to class .wpjb-job-apply – 2014-08-28 08:14:24

+0

@ChristianKobbernagel ...我想这就是你想要的.. – 2014-08-28 08:19:24

+0

$ ('span [itemprop ='employmentType']“)。each(function(){if($(this).text()=='Third Party Job') {('。wpjb-job-apply ')的CSS(' 显示”, '无'); } }); – 2014-08-28 08:28:58

0

怎么样:

$(function() { 
    $('span[itemprop="employmentType"]').each(function(){ 
     $this = $(this); 
     if($.trim($this.text() == "Third Party Job"){ 
      $this.addClass("wpjb-job-apply"); 
     } 
    }); 
});