Can div with contenteditable=true be passed through form?

前端 未结 4 917
失恋的感觉
失恋的感觉 2020-11-30 03:56

Can

Some Text
be used instead of texarea and then passed trough form someh
4条回答
  •  天命终不由人
    2020-11-30 04:51

    You could better use:

    
    

    NOTE: I changed innerHTML to innerText. This way you don't get HTML elements and text but only text.

    Example: I submited "text", innerHTML gives the value: "\r\n text". It filters out "text" but it's longer then 4 characters. innerText gives the value "text".

    This is useful if you want to count the characters.

提交回复
热议问题