web

[jquery] 테이블 엘리먼트 접근(accessing table element)

'김용환' 2017. 6. 1. 15:07

jquery에서 html의 테이블을 접근하려면 다음과 같이 진행한다.



$('#Table1 > tbody')



테이블 내용을 로그 화면에 출력하려면 다음과 같다.


$('#atable > tbody > tr[id]').each(function( index ) {

  console.log(index + ": " + $(this.id));

});



참조 싸이트


http://api.jquery.com/attr/


https://api.jquery.com/has-attribute-selector/







저작자표시 (새창열림)