Dowemo
0 0 0 0

<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>Document</title></head><body><aid="create"href="javascript:void(0)">创建列表</a></body></html><scripttype="text/javascript">var create = document.getElementById("create");
 var ul = document.createElement("ol");
 var num = 0;
 create.addEventListener("click",function() { tree(ul,{"width":100})
 },false);functiontree(obj,paramas) {if ( paramas == undefined) {
 return;
 }else {
 var li = document.createElement("li");
 if (paramas.background!== undefined) {
 li.style.background = paramas.background.toString();
 }else {
 li.style.background = "blue";
 }
 if (paramas.width!== undefined) {
 li.style.width = parseFloat(paramas.width)+'px';
 }else {
 li.style.width = 50+'px';
 }
 obj.append(li);
 document.body.append(obj);
 }
}</script>



Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs