1 <html> 2 <head> 3 <script type="text/javascript"> 4 function getStringById(id) { 5 var element = document.getElementById(id); 6 var str = element.value; 7 if (str == undefined) { 8 str = element.innerHTML; 9 } 10 return (str == undefined) ? "" : str; 11 } 12 13 window.onload = function() { 14 var text = getStringById('text'); 15 document.getElementById('area').innerHTML = text; 16 } 17 18 functi