doT.js模板如何生成select

var tpl='<select style="width: 100px;">

<option value="0" hidden></option>

{{ for(var i=0;i<it.selectlist.length;i++) { }}

{{if(it.selectlist[i].ID==it.nowid){ }}
<option value="{{=it.selectlist[i].ID}}" selected>{{=it.selectlist[i].name}}</option>
{{}else{}}
<option value="{{=it.selectlist[i].ID}}">{{=it.selectlist[i].name}}</option>
{{}}}

{{}}}

</select>';

  

posted @ 2015-10-22 10:34  LyzRecord  阅读(268)  评论(0编辑  收藏  举报