|
-
Jun 20th, 2004, 03:03 PM
#1
Thread Starter
New Member
Javascript: Passing text
Hi, I have a really basic question, but I'm just learning Javascript. I want to be able to have 4 links that have text assigned to them. for example, when you click on 'home' another part of the page will display the name 'home'. I have 1 page called index, and I have an iframe that i load all of the content into. I want one part of the index page to display what page that you are on in the iframe. Here is my code if it helps. If this is confusing, then just tell me and I will try to explain better.
<a href="home.htm" target="contentframe" onMouseover="nameofpage('Home')">Home</a>
<td class="nameofpage" background="images/nameofpage.gif" align="center" valign="center" name="NOP">
<script type="text/javascript">
function nameofpage(message)
{
document.NOP.write(message)
}
</script>
</td>
Thanks guys.
-
Jun 21st, 2004, 04:03 AM
#2
Hi,
Code:
<div id='NOP'>First display</div>
<a href='./Home.htm' onMouseOut='window.document.all.NOP.innerHTML="Second Display"' onMouseOver='window.document.all.NOP.innerHTML="<b>Home</b>"'> Home </a>
Try that.. cut n paste into a blank html file and see in ie to test - not sure it it will work with nutscrape, but worth a go.
You can always make it call a function instead, which accounts for browsers specific code 
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jun 21st, 2004, 01:23 PM
#3
Thread Starter
New Member
I'm sorry! i put mouseover... i meant to put click. when you CLICK the link, i want it to display the name of the link in another cell.
-
Jun 21st, 2004, 01:26 PM
#4
Thread Starter
New Member
OK, i just changed your code around a little and it works. thank you so much!
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
|
Click Here to Expand Forum to Full Width
|