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();





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