hi
sorry new to jscript (woops! javascript) and feeling stupid, checked
the faq and google to no avail. i've got a <td> with some text in it
that i wanted to chage, so i put this in it:
<span id="value">some text</span>
But this didn't work:
document.getElementByID('value').innerText=value;
any ideas? also, where can i find a reference so if i have, say, a
<span>, i can find all the properties and methods i can apply to it?
i've checked DOM references, but couldn't find what i needed.
cheers
dave 9 2183 ma**********@hotmail.com wrote: hi
sorry new to jscript (woops! javascript) and feeling stupid, checked the faq and google to no avail. i've got a <td> with some text in it that i wanted to chage, so i put this in it:
<span id="value">some text</span>
But this didn't work: document.getElementByID('value').innerText=value;
Because you are trying to set its value to a variable named value. Also,
innerText is IE only. See below.
any ideas? also, where can i find a reference so if i have, say, a <span>, i can find all the properties and methods i can apply to it? i've checked DOM references, but couldn't find what i needed. http://jibbering.com/faq/#FAQ4_15 and its DynWrite is what you are
hunting. It applies for SPAN tags as well as a DIV tag.
You could also give the TD tag an ID and DynWrite to it as well,
nullifying the need for a span inside the TD.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq ma**********@hotmail.com wrote: sorry new to jscript (woops! javascript) and feeling stupid, checked the faq and google to no avail. i've got a <td> with some text in it that i wanted to chage, so i put this in it:
[snip]
You can also use DOM methods to create a new text node and replace the
text node inside the TD. There are lots of examples in this news group
of how to do it.
Cheers, Fred
interesting. well i've tried this:
<td align="center" id="timeLength">some text</td>
and in js:
document.getElementByID('timeLength').firstChild.n odeValue="some other
text";
but it spits out an error. any ideas?
cheers
dave
<ma**********@hotmail.com> wrote in message
news:10**********************@k26g2000oda.googlegr oups.com... interesting. well i've tried this:
<td align="center" id="timeLength">some text</td>
and in js:
document.getElementByID('timeLength').firstChild.n odeValue="some other text";
but it spits out an error. any ideas?
Yes: getElementById(...)
<ma**********@hotmail.com> wrote in message
news:10*********************@k17g2000odb.googlegro ups.com... hi
sorry new to jscript (woops! javascript) and feeling stupid, checked the faq and google to no avail. i've got a <td> with some text in it that i wanted to chage, so i put this in it:
<span id="value">some text</span>
But this didn't work: document.getElementByID('value').innerText=value;
any ideas? also, where can i find a reference so if i have, say, a <span>, i can find all the properties and methods i can apply to it? i've checked DOM references, but couldn't find what i needed. cheers dave
JavaScript is case sensitive: getElementById not getElementByID
<html>
<head>
<title>changetd.htm</title>
</head>
<body>
<table border="1">
<tr>
<td id="value">some text</span></td>
</tr>
</table>
<script type="text/javascript">
document.getElementById("value").innerText = "some other text";
</script>
</body>
</html>
LOL i was looking at your answers for a while before i finally spotted
the small "d". regarding my other question again, does anyone know
where i can find a good complete online references to DOM methods and
attributes, so i can find things like "innerText", getChildNode, etc
for myself?
cheers
dave ma**********@hotmail.com wrote: LOL i was looking at your answers for a while before i finally spotted the small "d". regarding my other question again, does anyone know where i can find a good complete online references to DOM methods and attributes, so i can find things like "innerText", getChildNode, etc for myself?
cheers dave
Appart from the FAQ for this news group, you can try at Mozilla: http://www.mozilla.org/docs/web-developer/
They have links to many useful sites (including W3C specs). The Mozilla
DOM spec is very handy, but it's focuses on Mozilla (of course): http://www.mozilla.org/docs/dom/domref/
Wherever they say "DOM level 0", it is not part of the spec but it is
supported as legacy from older browsers.
Have fun - Fred.
<ma**********@hotmail.com> wrote in message
news:10**********************@k26g2000oda.googlegr oups.com... LOL i was looking at your answers for a while before i finally spotted the small "d". regarding my other question again, does anyone know where i can find a good complete online references to DOM methods and attributes, so i can find things like "innerText", getChildNode, etc for myself?
cheers dave http://www.w3.org/TR/2000/REC-DOM-Le...Core-20001113/
perfect! thanks for the help guys.
cheers
dave This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Martin Feuersteiner |
last post by:
Hi!
This is a very basic question.. don't make fun of me please!
I'm confused by all this logins, users, roles etc..
What I want to do it is to have an ASP.NET application that uses MSSQL as a...
|
by: Rut |
last post by:
I'm looking for a crash course in the use of xml. I am a programmer of
mostly client-server type apps hitting against sql server. I don't
program web related apps at all. I've taken classes in xml...
|
by: Stevey |
last post by:
I have the following XML file...
<?xml version="1.0"?>
<animals>
<animal>
<name>Tiger</name>
<questions>
<question index="0">true</question>
<question index="1">true</question>
</questions>
|
by: Zac Hester |
last post by:
I figured since a lot of us around here design sites for "customers" a lot,
I'd ask a general question that might help a lot of us in the future.
When dealing with clients asking for...
|
by: nospam |
last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types,
so, since it seems to me that Partial Types is still in the design or
development stages at Microsoft, I am going to ask...
| |
by: Joe Weinstein |
last post by:
Hi all. Sorry for the basic question... What's the syntax for creating a procedure
which simply returns a cursor for "select * from foo"? I am completely illiterate
about DB2, and I'm just...
|
by: Ekqvist Marko |
last post by:
Hi,
I have one Access database table including questions and answers. Now
I need to give answer id automatically to questionID column. But I
don't know how it is best (fastest) to do?
table...
|
by: VBCodr |
last post by:
Please don't nail me if this is the wrong forum - please
direct me to the right one.
I have been tech lead/architect on a very big asp/com+/vb6
internal app. I am trying to convince the powers...
|
by: mark |
last post by:
about the configuration manager's platform listbox. The choises are:
..NET and ACTIVE(.NET)
What's this about? I can't find it anywhere in the online help.
--
mark
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |
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...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |