select a tag and class javascript code example
Example 1: javascript get element by class
var elements = document.querySelector(".class");
Example 2: queryselector change alternative
var nome_cognome = document.querySelectorAll('.modal.fade input').forEach((input) => {
if ( input.classList.contains('.nome-cognome') ) {
input.addEventListener('keypress', () => {
console.log( input.value );
});
}
});