how do you strip html tags in textarea input

后端 未结 6 1671
自闭症患者
自闭症患者 2020-12-16 21:00

I have set up a little web application where you add post-its to a page. It\'s just a project to help better learn JavaScript/jQuery and it seemed like an appropriate projec

6条回答
  •  悲哀的现实
    2020-12-16 21:32

    $("textarea.text_input").on('keyup', function() {
        this.value = this.value.replace(/<(.|\n)*?>/g, '');
    });
    

    FIDDLE

提交回复
热议问题