I have this input line which I am trying to extract the text of the value attribute:
Node values and Element Attributes are different parts of an html tag.
So, you have to use element.value instead.
This is a an example, to show you how you can fetch value, data, attribute from an input field.
The HTML input field.
and the javascript.
var el = document.getElementById("user-profile");
console.log(el.value) // Simon
console.log(el.getAttribute("id")) // profile
console.log(el.dataset.nationality) // Eritrean