I am trying to use some use-full JavaScript code I found in codrop for creating custom select box, but i'm failing to bind this javascript function
(function() {
[].slice.call( document.querySelectorAll( 'select.cs-select' ) ).forEach( function(el) {
new SelectFx(el);
} );
})();
to dynamically added element.
Demo Code : http://codepen.io/AnandAyan/pen/rVpGPJ
Let's introduce jQuery .on
http://codepen.io/anon/pen/VLyMJO
But you probably want to trigger a function on the change though right?
UPDATED based on the comment discussion below with what I think is correct. Thanks @squint.