How to pass input data from input into a variable?

Hello.
As from the input data input to transmit the data to a variable?

April 18th 20 at 13:09
4 answers
April 18th 20 at 13:11
$("#input").on("input", function(e) {
 var value = $(this).val();
});
April 18th 20 at 13:13
$(button).click(function() {
 var input = document.getElementById('id').value;
});
April 18th 20 at 13:15
const input = document.getElementById('input');
const value = input.value;
April 18th 20 at 13:17
const value = document.getElementById("input").value;

Find more questions by tags jQueryJavaScript