- var map = {};
- $('.toolTable > tbody:eq(1)').children().each(function(i, dom) {
- var tds = $(this).children();
- for(var i=0;i<=2;i=i+2){
- var key = tds.eq(i+1).text(),value = tds.eq(i+0).text().substr(1);
- map[key] = map[key]?(map[key]+' '+value):value;
- }
- });
- for (i in map) {
- //console.log(i + '\\t' + map[i])
- document.write(i+'\\t'+map[i]+'<br/>');
- };
- //该片段来自于http://www.codesnippet.cn/detail/270820135329.html
来源: http://www.codesnippet.cn/detail/270820135329.html