2011-12-17 2 views

답변

1

이것은 로터리 방식처럼 보인다,하지만 당신은 할 수 :

$('div:contains('+$("<div/>").html('&#9660').text()+')').length 

http://jsfiddle.net/8r5Py/1/

또 다른 데모 :

$('div').each(function(){ 
    var $this = $(this); 
    if ($this.is(':contains('+$("<div/>").html('&#9660').text()+')')) { 
     console.log('Has entity: ' + $this.text()); 
    } else { 
     console.log('Does not have entity: ' + $this.text()); 
    } 
}); 

http://jsfiddle.net/8r5Py/2/

+0

고마워! 'contains() '셀렉터를'$ (this)'와 어떻게 사용할 수 있습니까? – charliesneath

+0

['$ (.is()'] (http://api.jquery.com/is/)는 실제로이 일을 의미합니다. http://jsfiddle.net/8r5Py/2/ –

+0

문자를 HTML 코드가 아닌 ▼을 사용할 때만 작동하는 것처럼 보입니다. 문제는 아니며 단지 관찰 일뿐입니다. – charliesneath