I have a value being updated by an HTML range slider through javascript. I need to grab this number as a variable in javascript. How can I achieve this? Here's what I have so far.
<form class="daysAR"
<label for="days">Days</label><br />
<input type="range" min="0" max="31" value="15" id="days" step="1" oninput="accountsRecievableSlider(value)">
<output for="days" id="daysInAR">15</output>
</form>
Javascript
function accountsRecievableSlider(AR) {
document.querySelector('#daysInAR').value = AR;
}
This is how I'm unsuccessfully trying to get the variable.
var selectday = document.querySelector('#daysInAR').value
document.write(selectday);
Thanks.