Господа вот код, в нем хочет работать innerHTML, что не так? =(
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
window.onload = function() {
document.getElementById('clicker').onclick = swop;
}
function swop()
{
/*var sScript="<SCRIPT DEFER>";
sScript = sScript + " document.write("Hello World!"); ";
sScript = sScript + "</SCRIPT" + ">";*/
this.innerHTML = '<script type="text/javascript" defer="true"><!--document.write("Hello World!");\/\/--><\/script>';
}
</script>
<style type="text/css">
div {
padding:20px;
margin:20px;
border:1px solid #000;
}
</style>
</head>
<body>
<div id="clicker">click me to change me</div>
</body>
</html>
Спасибо!