In my case, after a little modification, it works fine.
$('#txtTimeSlot').on('change', function () { var len = $(this).tagsinput('items');.length; if (len.length > 0) { var $input = $($(this).prev().children('input').get(0)); $input.attr('placeholder', ''); } else { var $input = $($(this).prev().children('input').get(0)); $input.attr('placeholder', $(this).attr('placeholder')); } });