jquery - How to make the Select Box Value selected to specific value "ABC" when new row is being added to table -
i have new row added table buttton click , have select element each row , name "code[]".i have make value "abc" selected when new row being added table
alert($('#mytabl tr:last :input').find('input[name="code[]"]').children($('option[value=abc]')).attr('selected','selected')); above statement no effect being done
it seems selector overly complicated, , not selecting <select>
element, looking <input>
inside :input
currently, try instead:
$('#mytabl tr:last select[name="code[]"]').val('abc');
Comments
Post a Comment