lastChild not working

前端 未结 6 872
予麋鹿
予麋鹿 2021-01-25 01:20

I have the following code:







        
6条回答
  •  清歌不尽
    2021-01-25 01:52

    is this your wanted behaivour?

    $(document).ready(function(){
         var lastchild   = $("div").last().attr("id")
         alert(lastchild);
         });
    
    
    

    check out this fiddle for live example

    http://jsfiddle.net/sHgbF/

提交回复
热议问题