简体   繁体   English

在 Javascript 中的 HTML 文本区域的内容上传递 function

[英]Passing a function on the content of a HTML textarea in Javascript

How can I pass a function on the content of a HTML textarea if the content is an array?如果内容是数组,如何在 HTML 文本区域的内容上传递 function?

eg:例如:

https://i.stack.imgur.com/8v0kg.png https://i.stack.imgur.com/8v0kg.png

the textarea.value is a string but I want to use a javascript function such that textarea.value.forEach() works textarea.value是一个字符串,但我想使用 javascript function 以便textarea.value.forEach()工作

Use JSON.parse() function to convert string into json object使用 JSON.parse() function 将字符串转换为 json ZA8CFDE6331BD59EB26AC96F8911C4

you can find more here JSON.parse你可以在这里找到更多JSON.parse

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM