Replace div text with content of tag
Tried searching but couldn't seem to come up with the language to yield any relevant results.
My problem is as follows:
I have a block of links inside of which are < smaller > tags which hold a generated piece of text. When a user clicks on one of these links (a.clip) I need the text within #fade to be replaced with the text inside of the < smaller > tags within that link.
This is the code I have which only partially works...
-
$(".clip").click(function(){
var title = $('smaller').html();
$('#fade').html(title);
return true;
});
However, regardless of which link is clicked the script will replace the html within #fade
with the parsed text from the first set of < smaller > tags on the page.
I feel like I should be using the
this attribute but don't know where to begin...
I know this is rudimentary but it's all new to me. Thanks for the help in advance.