HTML
<div id="a">h1</div>
<div id="b"><input type="text" /></div>
CSS
input{display:block;border:0;border-bottom:1px solid #ddd;line-height:2em;padding:0 10px;margin-bottom:10px;}
.h1{font-size:2em}
.h2{font-size:1.5em}
.h3{font-size:1.17em}
.h4{font-size:1em}
.h5{font-size:0.84em}
JAVASCRIPT
var sum ='';
for(var i = 1 ; i <= 5 ; i++){
//i = i.toString();
var k ='<h'+i+'>내가 원하는 건 h'+i+'</h'+i+'>';
sum+=k;
}
document.getElementById('a').innerHTML= '결과물<hr>'+sum
//
var sum ='';
for(var i = 1 ; i <= 5 ; i++){
//i = i.toString();
var k ='h'+i+'<input type="text" class="h'+i+'" placeholder="제목을 입력해주세요">';
sum+=k;
}
document.getElementById('b').innerHTML= '결과물<hr>'+sum