[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Changing a link to visited

Posted on 2003-10-26
4
Medium Priority
?
184 Views
Last Modified: 2013-12-25
Is there a way in Javascript to change a link to visited?  I have the following style:
a.external:visited {
      text-decoration:none;
      color:ffffff;
      font-weight:bold
}
a.external:active {
      text-decoration:none;
      color:ffff00;
      font-weight:bold
}
a.external:link {
      text-decoration:none;
      color:ffffff;
      font-weight:bold
}

to have the active link in yellow, with all others (in this class) in white.  This part works correctly.

Now I want one link to start as yellow then behave as the external class does above.

It seems easiest to be able to "click" that link onLoad to make it visited.

Anyone have any ideas or a different solution?

Thanks!
0
Comment
Question by:kkbenj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 17

Expert Comment

by:dorward
ID: 9771500
You can not change the visited state of a link with JavaScript.

You could do something like:

<a href="whatever" class="yellow" onmousedown="this.class='external';" onkeydown="this.class='external';">

although I'm not entirely clear what you want to achieve or why.
0
 
LVL 25

Accepted Solution

by:
Rouchie earned 2000 total points
ID: 9893783
If you want the link text to stay as VISITED, you can alter the order in which you declare the styles.  Link styles are declared in reverse-order of importance, so the last option always take priority over the previous one etc.

I'm not entirely sure what you're trying to achieve, but try this, then post some more details if required;

a.external:active {
     text-decoration:none;
     color:ffff00;
     font-weight:bold
}
a.external:link {
     text-decoration:none;
     color:ffffff;
     font-weight:bold
}
a.external:visited {
     text-decoration:none;
     color:ffffff;
     font-weight:bold
}

If you need to use the :hover class, also use this before the :visited one.
0
 
LVL 8

Expert Comment

by:CoolATIGuy
ID: 10379150
kkbenj,

Please deal with this old thread...


CoolATIGuy
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

649 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