HTML:
<div id="file-section">
<div class="middle">
<p class="description">
Lorem ipsum...
</p>
</div>
</div>
jQuery:
var share_on_addthis = {
description: $('#file-section .middle p.description').text(),
templates: { twitter: 'Default Message' }
}
I am having trouble extracting the text from the paragraph tag with the class "description" to use as the description in my jQuery script. When I tried using the code above, it did not return any text. The alert() function also showed no text. I believe there is an issue with my implementation.
This piece of code is meant to configure the AddThis Social Share feature on the website.
If anyone can assist me, I would greatly appreciate it.