473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

changing styles of createElement | appendChild

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
2 5471
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Free-Ed, Ltd. | last post by:
I am going nuts trying to find a paragraph in a book that described how to change the text content (HTML) in a DIV. Actually I have an array of HTML strings that I want to drop into the DIV,...
25
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to...
2
by: kie | last post by:
hello, when i create elements and want to assign events to them, i have realised that if the function assigned to that element has no parameters, then the parent node values can be attained. ...
55
by: Ton den Hartog | last post by:
Stupid basic question but I find it horribly imposible to find the answer elsewhere... :-( I want to have a piece of text in my HTML page and want to be able to change it in a Javascript...
4
by: sg_maat | last post by:
I have a little problem with createElement(and msie). I was experimenting a bit with createElement and made the following script: <script> var tmp = document.createElement("div");...
1
by: chris | last post by:
I've used JavaScript DOM scripting to create a table element and alter its opacity. Bizarrely, the contents of the table appear to vanish when the opacity changes. One important note is that I...
2
by: Urs Vogel | last post by:
Hi When using XmlDocument, I can create nodes and attributes as I like. What I didn't achieve is changing the Value of a node (created with createElement), it claims that it's the wrong node...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
7
by: petethebloke | last post by:
Can anyone help? I have a client who has made a "dynamic interactive map" of our city using Dreamweaver. Each map file has hotspots that pop-up a div with a little image when the mouse goes over...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.