Javascript Reference - Navigator javaEnabled() Method








The javaEnabled() method tells whether the browser has Java enabled.

Browser Support

javaEnabled Yes Yes Yes Yes Yes

Syntax

navigator.javaEnabled()

Parameters

None.

Return Value

Type Description
Boolean Tells whether the browser has Java enabled.




Example

The following code shows how to determine whether your browser has Java enabled.


<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">test</button>
<p id="demo"></p>
<script>
function myFunction() {<!-- w w  w.j  av a 2 s.c o m-->
    var x = "Java Enabled: " + navigator.javaEnabled();
    document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>

The code above is rendered as follows: