Delete Last Char of String with Javascript

前端 未结 9 734
独厮守ぢ
独厮守ぢ 2021-02-07 05:57

I have a DIV with some characters. How can I remove the last character from the text with each click on the DIV itself?

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 05:59

    This deletes a character each time you click on the div. Without more requirements, I can't give you any more.

    
    
    
        
    
    
    
    
        
    this is my div

    Oh, sorry, you asked for jquery... Well, this is how you do it in straight javascript.

提交回复
热议问题