//把所有内容全部设置到层中。
document.getElementById('btn1').οnclick=function(){
document.getElementById('dv').innerText='<h1>标题</h1>';
};
//把效果直接显示出来
document.getElementById('btn2').οnclick=function(){
document.getElementById('dv').innerHTML='<h1>标题</h1>';
};
//只获取文字内容
document.getElementById('btn3').οnclick=function(){
alert( document.getElementById('dv').innerText);
};
//获取该效果的所有标签和文本
document.getElementById('btn4').οnclick=function(){
alert( document.getElementById('dv').innerHTML);
};