Textarea类型特殊字符 [英] Textarea type special characters

查看:563
本文介绍了Textarea类型特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在textarea中,我希望用户能够按下键盘上的字母并键入𝒜ℬ𝒞𝒟等等(所以键入& ascr;& bscr;特殊字符)

In a textarea I want the user to be able to press the letters on their keyboard and type 𝒜ℬ𝒞𝒟 etc. (so typing the &ascr ; &bscr ; special characters)

无论如何都要这样做吗?并且让用户可以自由地编辑正常文本区域中的字符。

Is there anyway to do this? And have the user freely being able to edit the characters like in a normal textarea.

用户可以单击选择样式(设置我的 var style integer)和字母将是不同的样式,如𝔄𝔅ℭ𝔇 (& Afr;& Bfr;& Cfr;等等)

The user will be able to click to select a style (which sets my var style integer) and the letters will be a different style like 𝔄𝔅ℭ𝔇 (&Afr ; &Bfr ; &Cfr ; etc.)

我想在最后实现的是用户输入一个段落,然后文本将会在textarea中以这种方式显示格式,它们可以在两者之间切换样式。然后他们就可以复制文本/将其保存为.html文件。

What I want to achieve at the end is the user typing a paragraph, then the text will appear formatted in that way in the textarea, they could switch styles in between. Then they will be able to copy the text / save it as a .html file.

欢迎任何方法! :)

谢谢!

用户可输入的内容示例:您好我的名字是Friedpanseller!

Example of what the user could type: Hello my name is Friedpanseller!

textarea可以显示的内容:ℋℯ𝓁𝓁ℴ 𝓂𝓎 𝓃𝒶𝓂ℯ 𝒾𝓈 𝔉𝔯𝔦𝔢𝔡𝔭𝔞𝔫𝔰𝔢𝔩𝔩𝔢𝔯!

What the textarea could display: ℋℯ𝓁𝓁ℴ ℳ𝓎 𝒩𝒶𝓂ℯ ℐ𝓈 𝔉𝔯𝔦𝔢𝔡𝔭𝔞𝔫𝔰𝔢𝔩𝔩𝔢𝔯!

然后用户可以删除中间的一些单词/编辑它们就像普通的textarea

用户可以键入的内容示例:我的名字是Friedpanseller!

Example of what the user could type: My names are Friedpanseller!

textarea可以显示的内容:ℳ𝓎 𝓃𝒶𝓂ℯ𝓈 𝒶𝓇ℯ 𝔉𝔯𝔦𝔢𝔡𝔭𝔞𝔫𝔰𝔢𝔩𝔩𝔢𝔯!

What the textarea could display: ℳ𝓎 𝒩𝒶𝓂ℯ𝓈 𝒜𝓇ℯ 𝔉𝔯𝔦𝔢𝔡𝔭𝔞𝔫𝔰𝔢𝔩𝔩𝔢𝔯!

推荐答案

当您在空白html中添加代码时,请为jquery事件绑定添加document.ready。

When you are adding the code in blank html, please add document.ready for jquery event bind.

这篇关于Textarea类型特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆