Friday, October 17, 2008

Java Script dynamic Title

This javascript causes the message in the title bar to change every 10 seconds. 


javascript code :
----------------------

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function settitle() {
var a = "You can find every thing you need here. ";
var b = "Best collection of scripts";
var c = "Easy to use through cut & paste";
var t = new Date();
s = t.getSeconds();
if (s == 10) {
document.title = a;}
else if (s == 20) {
document.title = b;}
else if (s == 30) {
document.title = c;}
else if (s == 40) {
document.title = a;}
else if (s == 50) {
document.title = b;}
else if (s == 00) {
document.title = c;}
setTimeout("settitle()", 1000);
}
// End -->
</script>

Html code :
----------------------
<form>
Click&nbsp;<input type="button" onClick="settitle()" value="Start">
</form>

Labels: ,



2 Comments:

At February 24, 2009 at 1:35 PM , Blogger Creative india said...

the code is working

 
At February 24, 2009 at 1:35 PM , Blogger Creative india said...

the code is working

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home