Javacript 设置textarea高度
function settextareaHeight()
{
//textarea
var nodes = document.getElementsByTagName("textarea");
var b=false;
for (var i=0; i<nodes.length; i++)
{
if(nodes[i].value.length>300)
nodes[i].style.height="100%";
else
nodes[i].style.height="160px";
}
var nodes = document.getElementsByTagName("INPUT");
for (var i=0; i<nodes.length; i++)
{
var ctype = nodes[i].getAttribute("type");
if (ctype == 'button')
{
nodes[i].style.display="none";
}
}
}
{
//textarea
var nodes = document.getElementsByTagName("textarea");
var b=false;
for (var i=0; i<nodes.length; i++)
{
if(nodes[i].value.length>300)
nodes[i].style.height="100%";
else
nodes[i].style.height="160px";
}
var nodes = document.getElementsByTagName("INPUT");
for (var i=0; i<nodes.length; i++)
{
var ctype = nodes[i].getAttribute("type");
if (ctype == 'button')
{
nodes[i].style.display="none";
}
}
}