jQuery - How to get text from div > p

后端 未结 1 1111
别跟我提以往
别跟我提以往 2021-01-27 06:38

How to get the subject name from within a div class?

English

1条回答
  •  情书的邮戳
    2021-01-27 06:50

    $(".subject ").click(function() {
      // the script will declare here.
      alert('You are select ' + $(this).find('p').text() + ' subject ');
    });
    div {
      border:1px solid #999;
    
    

    English

    Biology

    Mathematic

    Science

    0 讨论(0)
提交回复
热议问题