Get paragraph text inside an element

后端 未结 9 711
孤独总比滥情好
孤独总比滥情好 2021-02-03 19:21

I want to have the text value from a

inside a

  • element.

    html:

  • 9条回答
    •  耶瑟儿~
      2021-02-03 20:06

      Add an Id property into the P tag with value like text or something:

      function gettext() {
          var amount = document.getElementById('text').value;
      }
      

    提交回复
    热议问题