I have written a small function in javascript to get user input from a text input form to be used as the delay time for fading away but it fails please help
<input type="text" class="form-control" id="new" placeholder="Fade Duration(milliseconds)"/>
var x = document.getElementById("new").value;
$(".fadeInbox").click(function () {
$("#section1").delay(x).fadeIn();
$("#section2").delay(x).fadeIn();
});
$(".fadeOutbox").click(function () {
$("#section1").delay(x).fadeOut();
$("#section2").delay(x).fadeOut();
});
var x = document.getElementById("new").value;tovar x = Number(document.getElementById("new").value);valueproperty of anHTMLInputElementreturns a stringvar x = $("#new").val();, writing much less