is it possible to implement hyperlink visited functionality using javascript onmouseover function?

is it possible to implement hyperlink Visited functionality of stylesheet using javascript onmouseover function?
coolgemini_99Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mudbuggleCommented:
What are you attempting to acheive?
0
coolgemini_99Author Commented:
When the user hovers over(not "On Click") a hyperlink, the hyperlink should follow CSS Stylesheets "Visited" format. So, when the user comes back to that page, that particular hyperlink will show in "Visited" color.
0
Frosty555Commented:
The css class "a:visited" is an example of a CSS pseudo-class. Because it is a pseudo-class, and not an actual class, you can't control it via javascript.

You will have to duplicate the CSS class to another one, give it a specific name, and use that in your javascript instead.

example:

a:link {
      color: #0000FF;
}
a:visited {
      color: #FF0000;
      font-weight: bold;
}
.myvisited {
      color: #FF0000;
      font-weight: bold;
}


<a href="blahblah.htm" onmouseover="this.className = 'myvisited'" onmouseout="this.className = ''">
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.