I have a snippet here that should show weather or not java is enabled. I had it set to run via onclick of a button, but I want to instead use an onload event in a P element to show the results.
the issue I am having is I get no results shown when i have set to an onload event, but it I create a button and use an onclick event it works.
what could be the issue here?
html
<p><strong>Display weather browser has java enabled.</strong></p>
<p id="javaAnswer" onload="checkJava()"></p>
javascript
function checkJava() {
var x = "Java Enabled: " + navigator.javaEnabled();
document.getElementById("javaAnswer").innerHTML = x;
}