I have this code in my html
<div class="modal-body">
{% for me in ako %}
Date: <input type="hidden" value="{{me.enddate}}" name="date" id="date">{{me.enddate}}
<input type="hidden" value="{{me.id}}" name="id" hidden><p>{{me.Email}}</p>
{% endfor %}
<select id="addDays">
{% for perfume in s %}
<option value="{{perfume.id}}" >{{perfume.product}} - {{perfume.adddate}} Days</option>
{% endfor %}
</select>
</div>
Example if the user selected the classic perfume it will add days in the {{me.enddate}}
7days + March 8, 2020 = March 15, 2020
just like that, but i dont know how to do it in script, please help me guys
i dont have code in my script cause i dont know how to do it and dont know how to display the result in my html, that is why i asked question here, thanks in advance to those who will able to help me with this problem
<script>
??????
</script>
UPDATE when i tried the answer of mr@JairReina the first selected works fine but when i try to selecting another option, it did'nt work
<div id="output" class="output"></div>
<script>
var date = new Date($('#date').val());
var addDays = $(".modal-body select option:selected").data('days');
date.setDate(date.getDate() + parseInt(addDays))
var dateTimeFormat = new Intl.DateTimeFormat('en-us', { year: 'numeric', month: 'long', day: 'numeric' });
var futureDate = dateTimeFormat.format(date);
$('.output').text(futureDate)
</script>
just like this but mine is seletion
