My control is built dynamically accordingly to user input, there are n
textboxes whose IDs are dynamic too.
However, I did not foresee that this HTML w
Even though is is wrong there is nothing wrong with the selector in jQuery
$('#Container1 #TextBox1').val(1)
$('#Container2 #TextBox1').val(2)
Demo: Fiddle
A better choice will be use attribute selector
$('#Container1 input[id="TextBox1"]').val(1)
$('#Container2 input[id="TextBox1"]').val(2)
Demo: Fiddle