$(this).val() not working to get text from span using jquery

后端 未结 7 1244
离开以前
离开以前 2020-12-01 00:23

Giving this html, i want to grab \"August\" from it when i click on it:

August

i tri

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-01 01:08

    Here we go:

    $(".ui-datepicker-month").click(function(){  
    var  textSpan = $(this).text();
    alert(textSpan);   
    });
    

    Hope it helps;)

提交回复
热议问题