changing styles of createElement | appendChild

K

kie

hi,

when i use appendChild, the following code ends in success

cellSec3=document.createElement('TD');

aTextBox=document.createElement('input');
aTextBox.type = 'text';
aTextBox.value = nz(s_unit_price);
aTextBox.size = '15';
aTextBox.name = 'txt_box'
aTextBox.onchange=onChangeEvent();

cellSec3.appendChild(aTextBox);

however, i would like to learn about the other attributes i can assign
to "aTextBox". does anyone know of any link to get me started?

As an example, I wish to change the alignment of the text inside my
text box, i have tried:

aTextBox.text-align = 'right';
aTextBox.style.text-align = 'right';
aTextBox.style.align = 'right';

among others, during searching i came across the term:

aTextBox.style.key = 1;

which does not seem to do anything, but causes no error, i'dg gratly
appreciate any help;

regards, kie
 
D

DU

kie said:
hi,

when i use appendChild, the following code ends in success

cellSec3=document.createElement('TD');

aTextBox=document.createElement('input');
aTextBox.type = 'text';
aTextBox.value = nz(s_unit_price);
aTextBox.size = '15';
aTextBox.name = 'txt_box'
aTextBox.onchange=onChangeEvent();

I'm pretty sure this last instruction won't work.
aTextBox.onchange = new Function ("evt", function body);
cellSec3.appendChild(aTextBox);

however, i would like to learn about the other attributes i can assign
to "aTextBox". does anyone know of any link to get me started?

As an example, I wish to change the alignment of the text inside my
text box, i have tried:

aTextBox.text-align = 'right';
aTextBox.style.text-align = 'right';
aTextBox.style.align = 'right';

aTextBox.style.textAlign = "right";
http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSS2Properties-textAlign
among others, during searching i came across the term:

aTextBox.style.key = 1;

Invalid.

which does not seem to do anything, but causes no error, i'dg gratly
appreciate any help;

regards, kie


DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 
V

Vjekoslav Begovic

kie said:
hi,

when i use appendChild, the following code ends in success

cellSec3=document.createElement('TD');

aTextBox=document.createElement('input');
aTextBox.type = 'text';
aTextBox.value = nz(s_unit_price);
aTextBox.size = '15';
aTextBox.name = 'txt_box'
aTextBox.onchange=onChangeEvent();

cellSec3.appendChild(aTextBox);

however, i would like to learn about the other attributes i can assign
to "aTextBox". does anyone know of any link to get me started?

You can see which attributes your browser supports running this code:

var str="";
for (var i in aTextBox)
str = str + i + ",\n";
document.write(str);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top