Current location: Hot Scripts Forums » General Web Coding » JavaScript » change text on click


change text on click

Reply
  #1 (permalink)  
Old 07-21-07, 01:12 PM
lylesback2 lylesback2 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Question change text on click

I'm looking for away to change text when i click on a link.

when i click "Change Text" i want it to change "Textword1" to "Something Different". I only found away to do it with a button, but it doesn't match my design.. so i want to change it via text link

thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-21-07, 02:26 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
There's not much difference to do it via a button or a link.
I'm guessing you use onclick="callCode()" in your button tag, right?
If you want, you can use the same for your link since it also supports onclick.
The browser might try to follow a link tho, so to be sure it won't, do something like this:
HTML Code:
<a href="#" onclick="callMyCode();return false">
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-25-07, 12:44 PM
semodders semodders is offline
Newbie Coder
 
Join Date: Jul 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
u are using frontpage then you have a toolbox called DHTML use that to change text when mouse over. good luck
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 07-25-07, 05:53 PM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
Quote:
I'm looking for away to change text when i click on a link.

when i click "Change Text" i want it to change "Textword1" to "Something Different". I only found away to do it with a button, but it doesn't match my design.. so i want to change it via text link

thanks
Sense you already have the button working, you can use CSS to make the
button look like an anchor element. By creating a class and assigning it to
the button element like this:
CSS Code:
  1. <html>
  2. <head>
  3. <style>
  4. .like_anchor
  5. {
  6.  border:none:
  7.  background:none;
  8.  text-decoration:underline;
  9.  color:#0000ff;
  10.  margin:0px;
  11.  }
  12. </style>
  13. </head>
  14. <body>
And the button:
HTML Code:
<button class="like_anchor"></button>
Then you can add the onclick='' and everything else to your button
like you already have.
__________________
Jerry Broughton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search script improvement 9999 PHP 14 08-29-06 12:46 AM
Draggable Tables Ares JavaScript 10 08-03-06 07:55 AM
Need Your HelP! Loading Multiple External Text into Multiple Dynamic Text Fields Flash_Boi Flash & ActionScript 2 03-30-06 04:27 PM
Change plain text Puno JavaScript 2 07-30-04 06:21 AM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 08:19 PM


All times are GMT -5. The time now is 12:53 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.