I found that if I just installed attr, for example. $("#city").attr('data-placeholder', 'bar') , no effect. However, if I set attr and then call $("#city").select2() with no arguments, then the placeholder is updated.
eg.
$("#city").attr("data-placeholder","bar"); $("#city").select2();
source share