I have an ajax 'POST'
method that sends the id
input to a php file. For some reason whenever I write input.value
method, it returns undefined:
input = document.getElementsByClassName("Input");
const id = input.value;
alert(id);
What am I doing wrong?
Edit: I tried making the element as a separate id instead of a class and the problem disappeared.