2014-08-28 29 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"); 
     } 
    }); 
});