在文本区域中显示存储的数据 [英] displaying stored data in textarea
本文介绍了在文本区域中显示存储的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将数据存储在YAML文件中,该文件是在特定日期从textarea(html页面)接收的.
I am storing data in a YAML file which is received from a textarea (html page) on a particular date.
在YAML中,它以以下格式存储:
In YAML it is storing in this format:
09_09_2015: ! "hello this is sireesha\n 1.some information \n2.some information"
当我从YAML获取此数据并将其显示在文本区域中时,它显示为:
When I get this data from YAML and display it in a textarea, it is displaying as:
"hello this is sireesha\n 1.some information \n2.some information"
我该如何克服这个问题并将其显示为
How can I overcome this and display this text as
hello this is sireesha
1.some information
2.some information
在文本区域?
推荐答案
使用jquery .text()
,在此处工作演示,"toTest"是您的文本区域的ID.
use jquery .text()
, Working demo here,'toTest' is the id of your text area.
$("#toTest").val($("<div/>").html("hello this is sireesha \n 1.some information \n2.some information").text());
这篇关于在文本区域中显示存储的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文