I am having trouble displaying the multiple selections that are chosen in the select box using JS/Jquery. I would like each value to display separated by a comma.
var selectionsInfo;
function setInfo(){
selectionsInfo = $("option:selected", "#custom-report").val();
document.getElementById("testInfo").innerHTML = selectionsInfo;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<select id="custom-report" name="creport" onchange="setInfo()" multiple="">
<option value=""></option>
<option value="10137">bubbles</option>
<option value="10131">fruit</option>
<option value="10132">koalas</option>
<option value="10139">pandas</option>
</select>
<div id="testInfo"></div>