Skip to content

Instantly share code, notes, and snippets.

@qinshulei
Last active August 29, 2016 10:25
Show Gist options
  • Save qinshulei/9ec29f831c04e1a21ae3a1976a3bf3d1 to your computer and use it in GitHub Desktop.
Save qinshulei/9ec29f831c04e1a21ae3a1976a3bf3d1 to your computer and use it in GitHub Desktop.
js replace select with select2
$().ready(function() {
$('head').append('<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>');
$('head').append('<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css">');
setTimeout(function(){
$('select').select2();
},1000);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment