Is the following behavior documented (i.e. should I rely on it)?
Due to an error, I got a dialog box and referred to its identifier using one word in javascript. Surprisingly, I did not get the error, and the code worked as intended
The example (on JSFiddle.net here ) has 2 simple dialog boxes
<div id="Hello">
<input id="box1" name="box1" type="text" value="not change">
</div>
<div id="Goodbye">
<input id="box1" name="box1" type="text" value="not change">
</div>
And javascript that lacks a string Hello = $("#Hello");.
$("#Hello").dialog({
autoOpen:false,
modal:true,
width:"auto"}
);
$("#Hello").dialog("open");
$("#Goodbye").dialog("open");
$('[name="box1"]',Hello).val("test");
Surprisingly, the last line updates the text box in the div Hello, but I can not find anywhere where this behavior is documented. Is this just an obscure side effect you can't rely on, or is it a valid jQuery selector style?
FYI, I am using Chrome Version 32.0.1700.107 m.