Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
replacing text with different text by clicking on it
Old 11-10-2010, 05:22 AM replacing text with different text by clicking on it
Junior Talker

Posts: 3
Trades: 0
i wanna replace simple text, with different text by clicking on it.

Example:

Let's say the text is : Hello
i wanna be able to click on it, and when i do, it will change to, let's say : Goodbye
And so on..

Anyone?

Thanks,
Magon(Beginner)
magon is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-10-2010, 05:27 AM Re: replacing text with different text by clicking on it
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
HTML Code:
<span onclick="this.innerHTML='Goodbye';">Hello</span>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-10-2010, 05:38 AM Re: replacing text with different text by clicking on it
Junior Talker

Posts: 3
Trades: 0
Thanks, it's already very helpful!

Now, why cant i see a hand sign when i roll over?
i'm afraid, just like that it wouldn't be understood.
And also i want it to be able to come back to hello on second clic, or to go to a third text and so on.

and on the way, how do i change text color on roll over?

I think that's all,
Thanks very much
Magon
magon is offline
Reply With Quote
View Public Profile
 
Old 11-10-2010, 05:42 AM Re: replacing text with different text by clicking on it
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Now, why cant i see a hand sign when i roll over?
because it is not a link. Use CSS to change the cursor

Quote:
and on the way, how do i change text color on roll over?
Use CSS
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-11-2010, 01:43 AM Re: replacing text with different text by clicking on it
Junior Talker

Posts: 1
Trades: 0
it is not a link. Use CSS to change the cursor




Strategic Change | Strategic Planning
martin88 is offline
Reply With Quote
View Public Profile
 
Old 11-11-2010, 06:34 AM Re: replacing text with different text by clicking on it
Average Talker

Posts: 28
Trades: 0
cursorointer;cursor:hand

use both for cross-browser compatibility.
Phil18 is offline
Reply With Quote
View Public Profile
 
Old 11-13-2010, 03:12 AM Re: replacing text with different text by clicking on it
Backslider's Avatar
Experienced Talker

Posts: 40
Trades: 0
Quote:
Originally Posted by Phil18 View Post
cursorointer;cursor:hand

use both for cross-browser compatibility.
That's SO funny!!!

cursor:hand was only for IE5 !!!!!

Keep you CSS valid and please do not use cursor:hand
Backslider is offline
Reply With Quote
View Public Profile
 
Old 01-05-2011, 10:01 AM Re: replacing text with different text by clicking on it
Novice Talker

Posts: 8
Trades: 0
if you want to make it look like a link do this
<script>
function changeMySpan()
{
myspan = document.getElementById("myspan");
myspan.innerHTML = "Hello World";
}
</script>
<a href="#" onclick="
changeMySpan()" <span id="myspan">Hello</span>
Helper_24 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to replacing text with different text by clicking on it
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26769 seconds with 12 queries