I'm trying to create a link within a blockquote element with jQuery. Right now I'm at this stage:
var pullQuote = $('span.pull-quote').each(function(){
var $this = $(this),
hrefLink = 'http://example.com',
text = $this.text();
$('<blockquote>', {
class: 'quote',
text: text
}).prependTo( $this.closest('p'));
});
That creates the blockquote element with the text dynamical but I want to turn the text into link inside of the blockquote. The href isn't going to change so I can set that in a variable like I already have it.
Can I add something that will create the a tag inside of the blockquote to where I can still use the set variables? (Which is what I've been trying to do) Or do I need to just run this function and then create a new function which would handle adding the link?