How to remove extra white spaces using javascript or jquery?

后端 未结 4 2104
粉色の甜心
粉色の甜心 2021-02-05 04:16

I got HTML element contains this:

    
P6C245RO
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 04:46

    This code working fine, Here I have remove extra white spaces in TextEditor.

    var htmlstring =   $("#textareaCode").html().replace(/( )*/g, "");
    

    for more Deatils refer: http://www.infinetsoft.com/Post/How-to-remove-nbsp-from-texteditor-in-jQuery/1226#.V0J-2fl97IU

提交回复
热议问题