With some HTML like this:
Some Text
Then some CSS like this:
p {
color:black;
}
p:hover {
color:red
My personal taste is to attribute the :hover styles to the :focus state as well, like:
p {
color: red;
}
p:hover, p:focus {
color: blue;
}
Then with the following HTML:
WOOOO
And the following JavaScript:
$("#some-p-tag").on("touchstart", function(e){
e.preventDefault();
var $elem = $(this);
if($elem.is(":focus")) {
//this can be registered as a "click" on a mobile device, as it's a double tap
$elem.blur()
}
else {
$elem.focus();
}
});