Social Icons

Pages

JAVA EXample to GeT the Greetings

<!DOCTYPE html>
<html>
<body>

<p>Click the button to get a greeting.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction()
{
var x="";
var time=new Date().getHours();
if (time<12)
  {
  x="Good day";
  }
else if (time<16)
 {
 x="Good afternoon";
 }
else if (time<19)
 {
 x="Good evening";
 }
else
 {
 x="Good night"
 }
document.getElementById("demo").innerHTML=x;
}
</script>

</body>
</html>






Click the button to get a greeting.








Example of HTML+JAVA to see how much time had been spent by you on my blog










Click on the "Start count!" button above to start the timer. The input field will count forever, starting at 0. Click on the "Stop count!" button to stop the counting. Click on the "Start count!" button to start the timer again.


HTML+JAVA to see how much time had been spent by us there


<html>
<head>
<script>
var c=0;
var t;
var timer_is_on=0;

function timedCount()
{
document.getElementById('txt').value=c;
c=c+1;
t=setTimeout(function(){timedCount()},1000);
}

function doTimer()
{
if (!timer_is_on)
  {
  timer_is_on=1;
  timedCount();
  }
}

function stopCount()
{
clearTimeout(t);
timer_is_on=0;
}
</script>
</head>

<body>
<form>
<input type="button" value="Start count!" onclick="doTimer()" />
<input type="text" id="txt" />
<input type="button" value="Stop count!" onclick="stopCount()" />
</form>
<p>
Click on the "Start count!" button above to start the timer. The input field will count forever, starting at 0. Click on the "Stop count!" button to stop the counting. Click on the "Start count!" button to start the timer again.
</p>
</body>
</html>

Error message











Click the button to wait 2 seconds, then alert "Hello".

After clicking away the alert box, an new alert box will appear in 2 seconds. This goes on forever...