Write a code to create a scrolling text in a text box
Write a code to create a scrolling text in a text box
Code
<html>
<script>
var sp;
var k;
k=0;
sp=" ";
function scroll()
{
f1.t1.value=sp+"welcome";
sp=sp+" ";
k=k+1;
if(k>=30)
{
sp=" "
k=0;
}
window.setTimeout("scroll()",100);
}
</script>
<body onload="scroll()">
<form id="f1" method="post">
<input type="text" size="50" id="t1">
</form>
</body>
</html>
output
Code
<html>
<script>
var sp;
var k;
k=0;
sp=" ";
function scroll()
{
f1.t1.value=sp+"welcome";
sp=sp+" ";
k=k+1;
if(k>=30)
{
sp=" "
k=0;
}
window.setTimeout("scroll()",100);
}
</script>
<body onload="scroll()">
<form id="f1" method="post">
<input type="text" size="50" id="t1">
</form>
</body>
</html>
output
Comments
Post a Comment