-4
(this) .text()를 사용하여 LI 항목의 텍스트를 찾으려고하지만 텍스트 방법이 없다고 알려줍니다. LI의 텍스트를 어떻게 참조 할 수 있습니까?클릭 이벤트에서 LI의 텍스트 찾기
$('.mylist').on('click','li',function() {alert('fired '+(this).text());});
<body>
<ul class=mylist>The unordered list
<li id=one>test one</li>
<li id=two>test two</li>
</ul>
</body>
빈 그것은 $(this).text()
대신 (this).text()
당신은'$를'누락로 변경 ""에 있어야합니다. – undefined