这里的JavaScript内部html我试图使用Bootstrap Button Group水平显示两个按钮。喜欢这张图片
虽然它在HTML中运行良好,但不知道为什么它会在内部HTML中产生问题。这是JavaScript代码段
var div = document.createElement('div');
div.className = 'row';
div.innerHTML = '<div class="container-fluid" style="background-color: #b5ffaa; height: auto; width: auto"\
<div class="row"\
<br>\
<div class="col-sm-8">\
<h2 style="color: #000000">' + name + '</h2>\
<h3 style="color: #000000">' + type + '</h3>\
<h4 style="color: #000000">Salary: ' + sal + '</h4>\
<h4 style="color: #000000">Location: ' + d[0] + ',' + d[1] + ',' + d[2] + ',' + d[3] + ',' + d[4] + ',' + d[5] +'</h4>\
<br>\
</div>\
<br><br><br>\
<div class="btn-group btn-group-lg">\
<button type="button" class="btn btn-primary" onclick="job_info()" href="#jobdetails">More Details</button>\
<button type="button" class="btn btn-primary">Apply</button>\
</div>\
</div><br></div>';
document.getElementById('content').appendChild(div);