데모 주소: http://demo.jb51.net/js/2011/js_select/index.htm
데이터
var data=[
{id:1,name:"Front-end Development",pid:0},
{id: 2,name:"CSS",pid:1},
{id:3,name:"JS",pid:1},
{id:4,name:"HTML" ,pid:1} ,
{id:5,name:"database",pid:0},
{id:6,name:"SQLServer",pid:5},
{id: 7,이름:" MYSql",pid:5},
{id:8,이름:"Oracle",pid:5},
{id:9,이름:"PLSQL",pid:8}
];
무한 레벨 선택 데모1
var deco1=Doc.Get("demo1");
var chg=function(obj){
if(obj.options.length>1){
obj .selectedIndex=0;
데모1.appendChild(obj);
}
}
var sel1=new Select(data,chg)
var _arr=sel1.getDom(); 🎜>for(var i=0 ;i<_arr.length;i ){
demo1.appendChild(_arr[i])
}
무한 레벨 선택 데모2
var deco2=Doc.Get("demo2") ;
var chg=function(obj) {
if(obj.options.length>1){
obj.selectedIndex=0;
demo2.appendChild(obj)}
}
var sel=new Select (data,chg)
var _arr=sel.getDom(9)
for(var i=0;i<_arr.length;i ){
demo2.appendChild(_arr[i])
}