[jQuery] click() problem in IE6 / IE7

[jQuery] click() problem in IE6 / IE7


Hi,
I have tried the following code:
<html>
<head>
<title>TEST</title>
<script type="text/javascript" src="jquery-1.2.1.min.js"></
script>
</head>
<script language="javascript">
function test2() {
alert('hi');
}
function test() {
$('#test').html('<a href="#" onclick="test2();">Generierter
Link</a>');
$('#test').click();
}
</script>
<body>
<div id="test" style="background:#fc6;"> </div>
<a href="#" onclick="test();">Testen</a>
</body>
</html>
An anchor tag is automatically inserted. Then the current onclick-
function ("test2") should be raised. In Firefox it works fine. But in
IE6 / IE7 nothing happens.
Thanks for help,
chris