For example, I have a page1.html
with this code:
<html lang="en">
<head>
<meta charset="UTF-8">
<title>page1</title>
</head>
<body>
<select style="width:100%" class="select2">
<option value="AK">Alaska</option>
<option value="HI">Hawaii</option>
</select>
</body>
</html>
and have a myscript.js
$('.select2').select2({
allowClear : true,
width : '100%'
});
Now, I want to load dynamically select2.min.js
where .select2
class located. what should I do?