Hi,
Can anyone explain me, why
this code doesn’t work, please ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta name="content-language" content="en" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
var myJqueryTest = {
$ref : $('#target1'),
init: function(){
console.log(typeof myJqueryTest.$ref);
console.log(typeof $('#target2'));
myJqueryTest.$ref.text('My test 1');
$('#target2').text('My test 2');
}
}
$(myJqueryTest.init);
</script>
</head>
<body>
<div id="target1"></div>
<div id="target2"></div>
</body>
</html>
Bye.