Skip to main content
edited body
Source Link

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')); } }); 

In my case, after a little modification, it works fine.

$('#txtTimeSlot').on('change', function () { var len = $(this).tagsinput('items'); 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')); } }); 

In my case, after a little modification, it works fine.

$('#txtTimeSlot').on('change', function () { var len = $(this).tagsinput('items').length; if (len > 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')); } }); 
Improved wording.
Source Link
Pang
  • 10.2k
  • 146
  • 87
  • 126

inIn my case, after a little modifying workmodification, it works fine.

$('#txtTimeSlot').on('change', function () { var len = $(this).tagsinput('items'); 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')); } }); 

in my case after little modifying work fine.

$('#txtTimeSlot').on('change', function () { var len = $(this).tagsinput('items'); 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')); } }); 

In my case, after a little modification, it works fine.

$('#txtTimeSlot').on('change', function () { var len = $(this).tagsinput('items'); 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')); } }); 
Source Link

in my case after little modifying work fine.

$('#txtTimeSlot').on('change', function () { var len = $(this).tagsinput('items'); 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')); } });