I use mouseover to get the cursor type, i get different results in Chrome and in Firefox when mouse is over for some reason the cursor style in Chrome is "auto" and in Firefox is "text". I need to know when the cursor is default in both browsers and when it's auto (as it's suppose to be over text input) or text. .
I wrote a simple code here to reproduce the issue, try it on both Chrome and Firefox and see the difference (here it is at jsfiddle if you want to play with the code).
Thanks in advance :)
window.onmouseover=function(event) {
var currentCursor = $(event.target).css('cursor');
console.log(currentCursor);
$('#pointer').html(currentCursor);
};
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<input type="text" width="100">
<p>Move the mouse in and out the input field</p>
<p id='pointer'></p>
Chrome and Firefox probably use a different default sheet for the input controls.
If you want to be sure you can set your own stylesheet and force the cursor to be 'text' of inputs of type text.
window.onmouseover=function(event) {
var currentCursor = $(event.target).css('cursor');
console.log(currentCursor);
$('#pointer').html(currentCursor);
};
input[type="text"] {
cursor:text
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<input type="text" width="100">
<p>Move the mouse in and out the input field</p>
<p id='pointer'></p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With