JavaScript Reference/Javascript Methods/hasFocus

Материал из Web эксперт
Перейти к: навигация, поиск

"hasFocus()" Example

    
<html>
<body>
<button onclick="alert(document.hasFocus());">HasFocus</button>
</body>
</html>



"hasFocus()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |document                                                      |
+----------------+--------------------------------------------------------------+



"hasFocus()" Syntax, Parameters and Note

Note:
Does the document have focus. 
Returns true or false.
    
Syntax:
    
document.hasFocus()