You’re trying to use title1
before it’s defined. swap the lines
var title1 = $('#node-264152').find('.audio-description').html();
var linkText = document.createTextNode(title1);
Should be noted that since you’re already using jQuery, you could do
var title1 = $('#node-264152').find('.audio-description').html();
$('<a />', {
href : 'http://www.someprivatelink.net',
title : title1,
text : title1
}).appendTo('body');
1
solved jQuery doesn’t give a proper output, but gives these [closed]