Edit in JSFiddle

$(function() {
    $('div').before($('<em>before text - </em>'));
    $('p').before($('<em>').attr('title', 'text title attr').text('before text with title attr - '));
});
<div>div</div>
<p>paragraph</p>

External resources loaded into this fiddle: