var span = '<span class="we w_o_r_d_s" id="we" contenteditable="false">we</span>'
console.log(span.id);
console.log(span.attr('id'));
console.log(span.getAttribute('id'));
var div = document.createElement('div');
div.innerHTML = span;
console.log(div.id);
console.log(div.attr('id'));
console.log(div.getAttribute('id'));
//I want to log `we`
I looked here but couldn't get it. THanks.