I'd do something like:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
jQuery(function($){
var tc = $('#tempcontainer').append('10'), num = 10, prefix = ', ';
setInterval(function(){
tc.append(prefix + (--num));
if(num < 1){
num = 11;
}
}, 1000);
});
</script>
</head>
<body>
<div id="tempcontainer"></div>
</body>
</html>
If you wanted to do without jQuery:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div id="tempcontainer"></div>
<script type="text/javascript">
(function(){
var tc = document.getElementById('tempcontainer'),
tn = document.createTextNode('10'), num = 10, prefix = ', ', tnc;
tc.appendChild(tn);
setInterval(function(){
tc.appendChild(tnc = tn.cloneNode(false));
tnc.nodeValue = prefix + (--num);
if(num < 1){
num = 11;
}
}, 1000);
})();
</script>
</body>
</html>
Bookmarks