...

View Full Version : Probably a newb question..



crunchymilk
06-30-2007, 12:35 AM
Okay, so I'm very new to HTML but I am making an attempt to learn. I'm attempting to design a page right now and I had something in mind. Problem is, I'm not sure how to do it. That's why I came to you!

What I want to do is pretty simple. It would appear to be just plain text on a page except when you roll over the text, it changes. On the site, I want the text to simply say 'Enter.' But when they roll over it, it should change to 'Site Under Construction.' Pretty nifty, eh?

Thank you to anyone that can help me! I appreciate it, believe me.

-crunchymilk

Arbitrator
06-30-2007, 12:51 AM
<a onmouseover="this.firstChild.data = 'site under construction';">enter</a>

The script portion of the above code should probably be placed within a script element or an external file.

Iím not sure why you would want to do this though. I would think that it be more intuitive to simply say up front that the site is under construction.

crunchymilk
06-30-2007, 01:01 AM
<a onmouseover="this.firstChild.data = 'site under construction';">enter</a>

The script portion of the above code should probably be placed within a script element or an external file.

Iím not sure why you would want to do this though. I would think that it be more intuitive to simply say up front that the site is under construction.
Thank you! I have only one question. Is there anyway to have it change back into "Enter" when they take there mouse off the text?

As for your question, I'm not creating a real website or anything, I'm just experimenting. That looked fun so I figured I'd try it out. :thumbsup:

Arbitrator
06-30-2007, 02:09 AM
Is there anyway to have it change back into "Enter" when they take there mouse off the text?
<a onmouseover="this.firstChild.data = 'site under construction';" onmouseout="this.firstChild.data = 'enter';">enter</a>

If you donít understand it:

this refers to the current element. In this case, that would be the anchor (a) element.
firstChild refers to the first child node of the current element. In this case, that would be a text node.
data is the content of the text node; its initial content is the word ďenterĒ.

crunchymilk
06-30-2007, 03:17 AM
Thanks! :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum