Jump to content

adding new field to page. how to specify the width instead of cols of box


jasonc

Recommended Posts

I am currently using

 

form_field.cols=20;

in my code below to say how many columns, but wish to use the CSS width instead, how do I do this using javascript

 

var container=document.getElementById('namesdiv');
var form_field=document.createElement('textarea');
form_field.id='name' + lines;
form_field.name='name' + lines;
form_field.cols=20;
form_field.rows=2;
container.appendChild(form_field);
var br_field=document.createElement('br');
container.appendChild(br_field);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.