I\'m trying to get the content of a span when a button is clicked. This is the html:
Here is a Jsfiddler demo using jQuery next
http://jsfiddle.net/vVK54/1/
$('button.select-location').live('click', function(event){ // set the span value var span_val = $(this).next().html(); alert('selecting...' + span_val); });