textarea的价值?如何填补一个? [英] Value of textarea? how to fill one?

查看:124
本文介绍了textarea的价值?如何填补一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用javascript填充 textarea ,事情是我发现 textarea 不有值标记,< textarea ..>< / textarea> 不是一个选项,因为我不能使用它与JavaScript。 b

编辑:

$ p $ content.document.getElementsByName(cr-work-desc0)。innerHTML =125645;
content.document.getElementsByName(cr-work-urls0)。textContent =这是一些示例文本;
content.document.getElementsByName(infringing-urls0)[0] .setAttribute(value,testing to);


解决方案

只需通过<$ c设置字段的值$ c> document.getElementById('thefield')。value ='value'。


I am trying to fill a textarea using javascript, the thing is i found out that textarea doesn't have the value tag, and <textarea ..></textarea> is not an option since i cant use it with javascript.

Edit :

content.document.getElementsByName("cr-work-desc0").innerHTML = "125645";
content.document.getElementsByName("cr-work-urls0").textContent = "this is some sample text";
content.document.getElementsByName("infringing-urls0")[0].setAttribute("value","testing to");

解决方案

Just set the value of the field via document.getElementById('thefield').value = 'value'.

这篇关于textarea的价值?如何填补一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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