How to change placeholder content of an input with jQuery.on in Bootstrap framework? -
i have input bootstrap placeholder , select. need when option selected, text of placeholder of input changes.
i think bootstrap.js binds it's objects when page loaded , after document.ready, changes in objects not affect.
my attempt:
$('select').on('change', function () { $('input').attr('placeholder',$(this).val()) });
that not work
$(document).on('change', 'select', function () { $('input').attr('placeholder', $(this).val()); });
you should assign ids or other selector target select
, target input
. code above execute on every input
time select
changed.
Comments
Post a Comment