views:

28

answers:

0

Anyone know why:

var strId = "xyz";
var oSectionOuter = $( "div#myr-body" ).find( "div#" + strId );

works in IE7 (actually IE8 with "Compatibility Mode") with the HTML below, but this doesn't?:

var strId = "xyz";
var oSectionOuter = $( "div#" + strId );

According to Microsoft's "excellent" Javascript debugger, oSectionOuter ends up being a reference to the whole DOM object rather than any particular node within it.

<html>
<body>
...
<div id="myr-body">
...
<div id="xyz">
...