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);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.