Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <script type="text/javascript">
- var liste = ["Hallo", "wie", "gehts"];
- var currentItem = 0;
- function next()
- {
- currentItem++;
- return liste[currentItem%liste.length];
- }
- function previous()
- {
- currentItem = (currentItem + liste.length - 1) % liste.length;
- return liste[currentItem];
- }
- document.write(next());
- document.write(previous());
- </script>
- <head>
- <title></title>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement