用惯了模板字符串,一时间不知道普通的+拼接字符串和变量怎么做了。虽然到现在也不能理解input赋值为什么这样写,但是先记录一下吧。
1、普通div拼接变量
str = '<div style="display: flex;justify-content: center;align-items: center"><div class="brown-circle" style="color: red;border-color: red"><span class="glyphicon glyphicon-bell"></span></div><div style="padding:6px 10px">'+yearTime+'<br/>'+hourTime+'</div></div>' ;
2、给input框value赋值
'<div class="col-xs-2 col-xs-2-new">'+
'<input class="form-control" name="respName" readOnly="true" value="'+obj.respName+'">'+
'</div>'