dynamic jQuery selector not working, when id is concatenated -


the following selector working,

var control = $('select[id^="control0"]')[0]; 

when use below selector, not working.

var index = 0; var control = $('select[id^="control' + index + '"]')[0]; 

appreciate help.

your code working me. need see html further.

here's how tested code: `

var index = 0;  var control = $('select[id^="control' + index + '"]')[0];    alert($(control).text())
<select id="control0">    <option value="1">1</option>  </select>

`


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -