I want to achieve this
$("div1 input").attr('id');
where div1 is dynamically generated through php loop ( so i have like div1,div2,div3 etc )
in my jquery function i have $('#counter').val();which holds calues from 1 to 3 dynamically,
so this is what i am doing $("#div"+ $("#counter").val() +"input").attr('id')
above code should give me input attribute id,
for some reasons or may be due to some syntax problem i am not getting it, Have a look and point out my mistake . Thanks in advance
You missed the space before
input, try this: