My First select2 try

54 views
Skip to first unread message

najem....@gmail.com

unread,
Nov 20, 2016, 8:27:18 AM11/20/16
to select2
Hello together,

this is my first try with select2 i can not get it work.
I just copied one of the simples examples.
Can you please tell me what ist wrong with this code?

<html>
<head>

<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
$(".js-example-basic-single").select2();
});
</script>

</head>
<body>

<select class="js-example-basic-single">
<option value="AL">Alabama</option>
<option value="WY">Wyoming</option>
</select>

</body>
</html>

Thank you very much.

lardenl...@gmail.com

unread,
Apr 9, 2017, 9:56:14 AM4/9/17
to select2, najem....@gmail.com
add this:

<script type="text/javascript" src="https://code.jquery.com/jquery.js"></script>

Reply all
Reply to author
Forward
0 new messages