Попробуйте использовать .append () вместо .text ()
$(document).ready(function () {
$("#eventname").change(function () {
$(".outputId").append($("#eventname option:selected").text())
})
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select class="form-control" for="eventname" name="eventname" id="eventname" data-val="true">
<option value="3e0ffa1d-c715-433c-b209-b6083bb43bf6" class="details" type="text">LeBron James</option>
<option value="3f66debb-a4f7-4c91-8bfc-a3fa62755f7d" class="details" type="text">Tester</option>
<option value="66653381-1009-4573-8d0e-640c57e94e5d" class="details" type="text">Jason Jones</option>
<option value="880c26f4-cb23-45ba-928b-50e9cd293c65" class="details" type="text">Sam Smith</option>
</select>
<div id="event">
<header></header>
<ul>
<li>
<p class="outputId"></p> `
</li>
</ul>
</div>
Прямое добавление li элемента к ul элементам списка
$(document).ready(function () {
$("#eventname").change(function () {
$(".outputId").append( '<li>' +$("#eventname option:selected").text() + '</li>')
})
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select class="form-control" for="eventname" name="eventname" id="eventname" data-val="true">
<option value="3e0ffa1d-c715-433c-b209-b6083bb43bf6" class="details" type="text">LeBron James</option>
<option value="3f66debb-a4f7-4c91-8bfc-a3fa62755f7d" class="details" type="text">Tester</option>
<option value="66653381-1009-4573-8d0e-640c57e94e5d" class="details" type="text">Jason Jones</option>
<option value="880c26f4-cb23-45ba-928b-50e9cd293c65" class="details" type="text">Sam Smith</option>
</select>
<div id="event">
<header></header>
<ul class="outputId"></ul>
</div>
Ограничить дубликаты с помощью всплывающего сообщения
$(document).ready(function () {
$("#eventname").change(function () {
let isDuplicate=false;
$('.outputId li').each(function(){
isDuplicate=$(this).text()==$("#eventname option:selected").text();
if (isDuplicate)
{
return false;
}
})
if($('.outputId li').length==0 || !isDuplicate){
$(".outputId").append( '<li>' +$("#eventname option:selected").text() + '</li>')
}
else{
alert('Duplicate Selected')
}
})
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select class="form-control" for="eventname" name="eventname" id="eventname" data-val="true">
<option value="3e0ffa1d-c715-433c-b209-b6083bb43bf6" class="details" type="text">LeBron James</option>
<option value="3f66debb-a4f7-4c91-8bfc-a3fa62755f7d" class="details" type="text">Tester</option>
<option value="66653381-1009-4573-8d0e-640c57e94e5d" class="details" type="text">Jason Jones</option>
<option value="880c26f4-cb23-45ba-928b-50e9cd293c65" class="details" type="text">Sam Smith</option>
</select>
<div id="event">
<header></header>
<ul class="outputId"></ul>
</div>