How to set background color for some inner text of

2019-05-29 04:43发布

facebook status

It looks like selected some text, but the background color will not disappear when you click it or move cursor.

3条回答
不美不萌又怎样
2楼-- · 2019-05-29 05:02

You can't use textarea element for this. Just make a contentEditable contentEditable div and use javascript to style it.

查看更多
做个烂人
3楼-- · 2019-05-29 05:09

That could be a div the styled during events and as other suggested make it contentEditable. With regards to textarea I have read similar question here. Check it if it's what your looking for.

查看更多
地球回转人心会变
4楼-- · 2019-05-29 05:11

It may be a div with contentEditable set to true

查看更多
登录 后发表回答