I have a new row added to table with a buttton click and we have select element for each row
and with name “code[]”.I have to make the value “ABC” as selected when a new row is being added to the table
alert($('#mytabl tr:last :input').find('input[name="code[]"]').children($('option[value=ABC]')).attr('selected','selected'));
with the above statement no Effect is being done
It seems like your selector is overly complicated, and not selecting a
<select>element, but looking for a<input>inside a:inputcurrently, try this instead: