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

后端 未结 7 1233
离开以前
离开以前 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:12

    You can use .html() to get content of span and or div elements.

    example:

        var monthname =  $(this).html();
        alert(monthname);
    

提交回复
热议问题