html控件

checkbox

val = "<li class='layer'><label><input type='checkbox' checked name='layers' class='layerSelect' id='" + layers_name_list[i] + "'><span>" + layers_name_list[i] + "</span></label></li>"

items = document.getElementsByName("layers");

判断是否选中:items[0].checked;

设置选中:items[0].checked = true;

 

整形变字符串:String()

字符串变整形:Number()

posted @ 2015-08-02 21:11  jihite  阅读(375)  评论(0编辑  收藏  举报