-
November 19th, 2005, 01:28 PM
#1
DOM question
I am looking to create a dynamic text section on my website...
what I currently have is this:
<span id="hidden"><a href="#" onClick="hidden_text()">(Read More)</a></span>
and:
function hidden_text(){
var hidden = document.getElementById('hidden');
hidden.firstChild.nodeValue='New text goes here';
}
but for some reason this just doesn't work, it doesn't error or anything.
I have tried this:
hidden.replaceChild='New text goes here';
to no avail either... however
<span id="hidden">ABC <a href="#" onClick="hidden_text()">(Read More)</a></span>
goes from:
ABC (Read More)
to
New text goes here (Read More)
effectively the same results with:
<span id="hidden"><a href="x.cfm">ABC</a> <a href="#" onClick="hidden_text()">(Read More)</a></span>
To ensure that there isn't some issue with change the link used to trigger the change.
so yeah... any ideas would be appreciated.
cheers,
catch
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|