i have several class="items" that include input and button, and i want to click button and identify whether function getValue() { // Select the input element and get its value var input = document.getElementById("in").value; // Display input value alert(input); } Result Get the value Browser Support The numbers in the table specify the first browser version that fully supports the element. function f1(objButton){ alert(objButton.value); } P.S: val() is actually a jQuery implementation of here I want input value in this function addButtonClickHandler(val) { alert("ddd"); let names = this.state.names.slice(); names.push(val); this.setState({ names: names }); } val is function getvalue () { console.log (this.val); }