Get content of span

后端 未结 5 1436
北恋
北恋 2020-12-19 05:08

how can I get the contents of span ? I\'m looking for a way for all of this to be vanilla, not jQuery

javascript (and a little jQuery)

var swear_word         


        
5条回答
  •  有刺的猬
    2020-12-19 05:36

    Give this a shot:

    var input = document.getElementById("myInput");
    var text = input.innerHTML;
    

提交回复
热议问题