Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS selector issues Reply To: CSS selector issues

#144388
TheDoc
Member

With help [from here](http://stackoverflow.com/questions/8568657/wrap-stray-text-in-divs “”):

$(‘.main’).contents().each(function() {
if ( this.nodeType === Node.TEXT_NODE ) {
$(this).remove();
}
});

Codepen example: http://codepen.io/ggilmore/pen/ff8eba56cd3427e42e59c05d8477f00f