js解析html字符串

var html = '    
sandong_R
fid TYPE_USER USER_SUBTY NAME
sandong_R.14 100 100 枣庄市

'; var el = document.createElement( 'div' ); el.innerHTML = html; var tds = el.getElementsByTagName('td'); var text = tds[3].innerHTML; alert(text);//枣庄市


你可能感兴趣的:(前端,htmlcss)