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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -