Forum Moderators: open

Message Too Old, No Replies

How to connect buttons to bodytext

Using Javascript

         

Ragus73

10:03 pm on Nov 2, 2007 (gmt 0)

10+ Year Member



I am very new to javascript, and this is probably very simple, but I haven't figured it out yet, so any help is appreciated. What I'm looking for is that when a button is clicked, it changes the text in the bodyText field to the text I have prepared ahead of time.
Ex. User Clicks "Contact" bodyText info changes to display my email address as well as "Please Email Me."
Thanks

Ragus73

7:35 pm on Nov 3, 2007 (gmt 0)

10+ Year Member



Ok heres a whole new thing, this is my newest site, heres the difficulty, basically the same problem, but using different code.

<tr>
<td width="155" height="40" align="center" bgcolor="#003300"><a href="javascript:document.bodytext.set = ('text','Heres some information about the run!')">Run Information</a></td>
</tr>

AND

<table border="0" cellspacing="0" cellpadding="0" width="505">
<tr>
<td width="505" height="41" class="pageName">Welcome!</td>
</tr>
<tr>
<td height="463" align="left" valign="top" class="bodyText"> Welcome to the official site of Speed of Rage. I'm here to get you somewhere! Please Feel Free to Explore this site and leave a comment for me.
<p><span class="subHeader">There has been a site update!</span><br />
Enjoy.</p> </td>
</tr>
</table>
Basically trying to tell the script to change the bodytext in code2, using code1. Doesnt work... So any help is much appreciated.

Ragus73

8:02 pm on Nov 4, 2007 (gmt 0)

10+ Year Member



This problem was resolved today. Here is the code that was used:

document.getElementById('youridhere').innerHTML = 'Text is ... changed!';