JSFiddle - React, Tailwind, and code Playground
HTML
<select name="server" id="server">
<option value="Default">Please Select Severity</option>
<option data-hours="12" value="Critical">Critical</option>
<option data-hours="24" value="Major">Major</option>
<option data-hours="36" value="Minor">Minor</option>
</select>
<input name="exc_date" id="exc_date" style="width:150px" type="text" />
JavaScript
window.onload = function(){
document.getElementById("server").onchange = function(){
var timeObj = document.getElementById("exc_date");
if(this.value != 'Default'){
var hours = this.options[this.selectedIndex].getAttribute('data-hours');
var now = new Date();
now.setHours(now.getHours() + (hours*1));
var nowStr = now.getDate() + "/" + (now.getMonth()+1) + "/" + now.getFullYear();
timeObj.value = hours + " hours, " + nowStr;
} else {
timeObj.value = '';
}
};
};