In the drop-down list, select the date:

<option value="1">31.05.2018 0:00:00</option> 

I write to js:

 var date = document.getElementById('AttendDate'); 

As a result, I get the value value equal to 1. How to get the date ???

    2 answers 2

     var date = document.querySelector('option:checked'); console.log(date.text); 
     <select id="AttendDate"> <option value="1">31.05.2018 0:00:00</option> </select> 

      As an option, use the "onChange" attribute and pass this to it.

       var getSelect = function(sel) { var date = sel.options[sel.selectedIndex].text; console.log(date); } 
       <select id="AttendDate" onChange="getSelect(this)"> <option selected>Выберите значение</option> <option value="1">31.05.2018 0:00:00</option> <option value="2">31.05.2018 10:00:00</option> </select>