DEV Community

Robiabo
Robiabo

Posted on

How can we apply pseudo-class on a single line without CSS?

Hello everybody,
I've learned how to apply pseudo-class by using CSS style.
For example,

a: hover {color: green}

.
My QUESTION:-
How can we apply pseudo-class like (hover, focus, active, visited, link) on a line WITHOUT CSS?
For example, on the following tag:

Is there a tag, atribute, value ...! How?

Top comments (4)

Collapse
 
kallmanation profile image
Nathan Kallman

As in, how in javascript do you detect hover/focus/etc?

There's a whole slew of mouse events (like onmouseover and onmouseleave will trigger for the beginning and ending of a "hover")
w3schools.com/jsref/obj_mouseevent...

Collapse
 
robiabo profile image
Robiabo

Thanks. But you mean by javascript!

Collapse
 
kallmanation profile image
Nathan Kallman

Yes, sorry I thought that's what was meant by "without CSS". Is the question asking for inline styling?

Collapse
 
richardsprins profile image
Richard S Prins Jr.

Pseudo classes won't work inline from my experience