1. 程式人生 > >元素選擇器之排除特定元素

元素選擇器之排除特定元素

    需求如下:該搜尋框是對整個頁面的input檢索 ,但與彈出層中的input衝突

博主幾經輾轉 簡單處理 解決問題,思路如下:排除掉特定class的input。

程式碼如下:

$('input:not(.pop)', this.footer()).on('keyup change', function () {
     if (that.search() !== this.value&&$(this).attr("type")!="file") {

         that.search(this.value).draw();
         list_overview_DataTableAll.status.save();
     }
 });