I have an up-vote button that has an child element with a dynamic id. How can I fetch the id of that child element?
I'm trying to add a voting feature to a blog site, and each blog has a unique ID that I need for the ajax call to log the vote in the database and also to update the vote tally in the html.
$(".plus").click(function() {
var myvar = $(".plus").find("h4");
console.log(myvar);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button class='plus'>
<h4>up</h4>
<h3 id='{{blog.id}}'>0</h3>
</button>