asp.net mvc - Removing element using jquery -
i using jquery token input in program , according select list change need pass parameter search function. able below code.
$("#service").on('change', '.act_type', function () { qq = $(this).val(); var id = $(this).attr('id').split('-'); $("#token-input-code-" + id[1]).detach(); $("#code-"+id[1]).tokeninput("../preapproval/searchactivitycode?queryparam=q" + "&type=" + qq,{ theme: 'facebook', preventduplicates: true, searchingtext: 'searching...', tokenlimit: 1, hinttext: 'activity code', }); the rows creating dynamically. detach current textbox having token input when change in select list done. otherwise new textbox created keeping old one. detaching old 1 , create new 1 same id , tokeninput. searching doing successfully. facing 1 issue.
the token input $("#token-input-code-" + id[1]) coming under <ul><li></li></ul , li , ul not getting removed small line appear in row top each time done change in select list. how can remove ul , li. not have id class , same class used ul element in form also.
try:
$('ul:has(li:empty)').filter(function() { return $(this).children().length === 1; }).remove();
Comments
Post a Comment