js的一些用法

  1. 一、獲取table裏的數據
  2. $("#tb > tr:last-child, #tb > tr:last-child *")
  3. // "#tb > tr:last-child"爲最後一個tr
  4. // "#tb > tr:last-child *"爲最後一個tr裏面所有的子元素的對象
  5. $("#tb").find("tr:last").children().text(); 
  6.  $('tr:last').before("<tr><td>312312</td><td>321321</td><td>321321</td></tr>");
  7. $('tr:eq(-3)').remove();
  8. $('table .activetr').remove();//刪除包含activetr類的tr
  9. 二、當li的click事件觸發不了時
  10. $('ul').delegate('li','click',function () {。。。。。。}
  11. 三、子頁面js觸發父頁面按鈕點擊事件

  12. window.parent.document.getElementById("btUserInfo").click();





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章