Если "это" пример... Тогда, как вариант
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<!--
<script src='http://code.jquery.com/jquery-latest.js'></script>
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<style type='text/css'>
</style>
<script type='text/javascript'>
var variable = 1;
document.write("Переменная равна " + variable);
window.onload=function(){
var o=document.getElementsByTagName('body')[0];
var str=o.innerHTML;
str=str.replace(/(\S+)(?=\n)/g,'<b>$1</b>');
alert(str);
o.innerHTML=str;
};
</script>
</head>
<body>
</body>
</html>
|