Javascript – Display alternate message in textbox

You can set timeout as your wish.

———————————————————————-

<html>

<script language=”JavaScript” type=”text/javascript”>
<!–

var text = 0;

var message=new Array();
message[0] = “Welcome to Rana’s Blog Code Project!”
message[1] = “Get free source code from Rana’s Blog.”
message[2] = “Solution will be provided on request.”
message[3] = “Good bye from Rana’s blog code project.”

function changeText() {
  if (message.length > 0) {
   document.change.descript.value=message[text];
   text++; }
  if (text == 4) {text = 0; }  // change the # 4 at the left to the maximum # of message lines you want included
   window.setTimeout(“changeText()”, 3500); }  // change the # on the left to adjust the speed of the
                                               // scroll. The smaller the # the faster the speed
//–>
</script>
<body onLoad=”changeText();”>

<!– This goes into the BODY of the html file –>

<form name=”change”>
  <textarea name=”descript” rows=”2″ cols=”33″ wrap=”virtual”></textarea>
</form>

</body>
</html>

Click here to download the source code : Displaying alternate messages

Advertisements

3 thoughts on “Javascript – Display alternate message in textbox

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s