Results 1 to 3 of 3

Thread: want to print each character of varialble one by one

  1. #1
    Join Date
    Sep 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default want to print each character of varialble one by one

    hello to all,
    <script langauge=javascript>
    var sno="1334";

    document.write(sno+"<hr>");

    var lstr=sno.length;
    document.write(lstr+"<hr>");

    document.write(lstr.snos(1));
    </script>


    i want to print each character of variable "sno" one by one
    i.e. 1,3,3,4 or
    1<br>
    3<br>
    3<br>
    4

    can you help me inthis

    Thanx Sameer

  2. #2
    Join Date
    Sep 2004
    Location
    Indonesia
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    var sno = '1234';
    for (var i = 0 ; i < sno.length ; i++)
    {
    	document.write(sno.charAt(i) + "<br>");
    }
    You mean like that?

  3. #3
    Join Date
    Sep 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thaxfor you help

    thanx ..

    actualy i wanted to show some no.. in score board like effect and it has to be realtime that isconnected with database..

    so using with cod givenby u i will split the no. and disply the correspondng image to get image effect ..

    any ways thanx a lot
    sameer

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •