Solved

Condidional <a href = ....>

Posted on 2016-11-01
1
30 Views
Last Modified: 2016-11-01
I need to have an anchor tag that will be followed through depending upon a condition. I see to recall I can do something like <a href="somepage.html" onClick="return chk_link();">xxx</a>

If I don't want the link followed, the chk_link() Javascript will return false, otherwise true.

Does that work?

Thanks
0
Comment
Question by:Richard Korts
1 Comment
 
LVL 35

Accepted Solution

by:
Terry Woods earned 500 total points
ID: 41869371
Yes; demo here: https://jsfiddle.net/gny3dnew/

Javascript:
chk_link = function() {
  return false;
}

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
control character echo in html input field with javascript or jquery 7 33
angular2 2 way binding on load 7 38
Download a website to hdd 2 48
WordPress Themes 10 34
This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now