I came up with the jquery javascript below
$(document).mousemove(function(event) {
var element = event.target;
$(element).css("border","black solid 1px");
});
$(document).mouseout(function(event) {
var element = event.target;
console.log( "1 = "$(element).css("border-color") )
$(element).css("border","0px");
console.log( "2 = " + $(element).css("border-color") )
});
This code creates a border around hovered elements. Despite this, when I tried running it in Chrome, the
console.log( "1 = "$(element).css("border-color") )
and console.log( "2 = "$(element).css("border-color") )
outputs nothing instead of black, which I expected. I tested using borderColor
as well, but no success.
Despite the lack of output in the console logs, the code successfully draws frames around hovered elements. Why do you think the console is not displaying the expected color value?