How to hide Link in Jscript

2 replies
  • WEB DESIGN
  • |
Hi guys,

Hope you are all doing good. Today I've got a javascript question.

I've been trying to use a Toggle text option in one of my website and found a perfect script too. (see attached file | save it in HTML to preview the script)

As you can see in the script, when you click the link; Call Now, a number appears and "Call Now" link moves downwards.

Now here's what I want with the link:
After clicking the Call Now, I want the same link to get disappear/hide

EDIT: One more thing, I noticed that the LINK is not correct as when I uploaded it to my hosting, after opening the Number, it is redirecting to the html page (the page where this script is saved) on auto.

Actually, the current link was a BUTTON, but I want to place a link here; instead of form button.

Please help.

Would appreciate your response.


A good example of what I require:
http://www.doctor.com/Dr-Marina_Gafanovich (click on the phone or fax number)

Good day,
#hide #jscript #link
  • Profile picture of the author Brandon Tanner
    The file you attached is way more code than is necessary to do what you want, and there are several mistakes in it.

    If all you want to do is make the text in that link change from "Call Now" to "1 92 313 1114" when it's clicked (similar to the doctor.com page), then all you have to do is this...

    HTML Code:
    <!DOCTYPE html>
    <html>
    <body>
    <a href="#" onClick="this.innerHTML = '1 92 313 1114';">Call Now</a>
    </body>
    </html>
    Is that what you're after?
    Signature

    {{ DiscussionBoard.errors[7969288].message }}
    • Profile picture of the author biznics
      Many thanks for the code mate. That's exactly what I was looking for.

      Regards,

      Originally Posted by Brandon Tanner View Post

      The file you attached is way more code than is necessary to do what you want, and there are several mistakes in it.

      If all you want to do is make the text in that link change from "Call Now" to "1 92 313 1114" when it's clicked (similar to the doctor.cm page), then all you have to do is this...

      HTML Code:
      <!DOCTYPE html>
      <html>
      <body>
      <a href="#" onClick="this.innerHTML = '1 92 313 1114';">Call Now</a>
      </body>
      </html>
      Is that what you're after?
      {{ DiscussionBoard.errors[7970231].message }}

Trending Topics