본문 바로가기

WebStudy

테이블 클릭시 값 가져오기

 

 

$("tr").click(function(event){
  if(this.rowIndex >=2){
   var add = '';
   var zip = '';
   $(this).children().each(function(idx){
    if(idx < $(this).parents().length-1){
     add += $(this).text();
    }else {
     zip = $(this).text();
    }
   });
   alert(add + '\n' + zip);
  }
 });

'WebStudy' 카테고리의 다른 글

비동기 통신, AJAX - javascript  (0) 2015.06.22
창 열기, 부모창으로 값 전달, 자식창 닫기  (0) 2015.06.22
config  (0) 2015.06.18
jsp 수업정리 - 08  (0) 2015.06.18
jsp 수업정리 - 07  (0) 2015.06.18