Simple example: I have html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="portal.css" />
<script type="text/javascript" src="/test/lib.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body onload="init();" class="body">
<div id="wrapper">
</div>
</body>
</html>
then I call
$("#wrapper").append(
"<div onclick=\"alert('TEST')\" style=\"background-color: aqua; width: 20px; height: 20px; position: absolute\">" +
"</div>"
);
so appears small box, when I click it in FF or Chrome - alert box appears.
But problem is: in IE8 onclick doesn't work. It works when I use .html("...")
.
Please, help me! =) Thank you!