I\'m trying to get the content of a span when a button is clicked. This is the html:
It's not button's parent. div is button's parent and span is children of the div. Try
div
button
span
var span_val = $(this).parent().children("span").html();
instead.
Working demo