JQuery get content of span

后端 未结 6 1720
萌比男神i
萌比男神i 2021-02-19 00:29

I\'m trying to get the content of a span when a button is clicked. This is the html:

6条回答
  •  时光取名叫无心
    2021-02-19 00:54

    $('button.select-location').live('click', function(event){
    
      var span_val = $(this).next("span").html();
    
      alert('selecting...' + span_val);
    
    });
    

提交回复
热议问题