jquery 表雙擊某行時,取出某行中各列的數值.


 
<script>
        $(function () {
            $("tr").dblclick(function () {
                var txt = $("table tr:eq(0) td:eq(1)").text();
                //alert(txt);
                var $this = $(this);//就是雙擊的該行.
                alert($this.children().eq(1).text()+$this.children().eq(2));//獲取該行下的列,eq(0)--第一列.
                testargument([12,23,11,55,78,32]);
            });
        });
        //test 2017.08.23
        function testargument()
        {
            var max = Math.max.apply(Math, arguments[0]);//獲取數組中最大值.max = 78,這樣免去了循環和if判斷.
            alert(max);
            //arguments.callee();
        }
    </script> 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM