select multiple elements with queryselector code example
Example 1: select 2 multiselect
//Installation
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
// In your Javascript (external .js resource or <script> tag)
$(document).ready(function() {
$('.js-example-basic-single').select2();
});
Example 2: queryselector multiple attributes
var ele = document.querySelector('class[attr=something][attr2=somtethingelse]');