By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

changing styles of createElement | appendChild

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DU
kie wrote:
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-Le...ties-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/doctorunc...e7Section.html

Jul 20 '05 #2

P: n/a
"kie" <ki*****@yahoo.com> wrote in message
news:58*************************@posting.google.co m...
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);
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.