내가

2010-08-08 5 views
1

나는이 HTML이 사용자 정의 HTML 태그를 선택 jQuery를 가지고 어떻게 :내가

Coral8 <del class="diffmod">SQL, to</del><ins class="diffmod">SQL,to</ins> improve 

내가 <ins> 태그를 잡아하고자합니다. 그것들은 사용자 정의 HTML 태그 인 것 같아요. 그래서 ID 나 클래스 이름이 없습니다.

jQuery 선택기를 사용하여 그 (것)들을 붙잡는 어떤 생각?

+0

이것은 XML 파일에서 가져온 것이므로 xpath와 함께하는 것이 더 좋습니다. –

답변

6

element selector$('ins')을 사용하면됩니다. 직접 시도해 보는 것은 거의 아닙니다.

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
     <title>SO question 3432853</title> 
     <script src="http://code.jquery.com/jquery-latest.min.js"></script> 
     <script> 
      $(document).ready(function() { 
       alert($('ins').text()); // SQL,to 
      }); 
     </script> 
    </head> 
    <body> 
     <p>Coral8 <del class="diffmod">SQL, to</del><ins class="diffmod">SQL,to</ins> improve 
    </body> 
</html> 

It works. 그건 그렇고, legitimately valid HTML tags입니다.