js 极简获取表单 元素 !

let s =[];
$.each($('#formSearch input'),(m,n)=>{s.push(n)});
//示例获取表单所有 input 下滑线分割的 name 集合。set 去重, concat 平铺。
let res = [...new Set( [].concat(...s.map(m=>m.split('_'))))];
//"", "Co", "Id", "Eq", "OrderNo", "OldNo", "SpecSN", "SupplierName", "SupplierGoodsNo", "Duration", "GrE", "ReceiveTime", "Le", "ReceiveUserName"

 

posted @ 2019-07-05 13:42  zwsu  阅读(378)  评论(0编辑  收藏  举报