Need Some Guidance with Jquery code here

//HTML

Click

<input type="text" id="in" placeholder="Input">

<p id="p"></p>

//Javascript

let Button = document.getElementById(‘Btn’);

Button.addEventListener(‘click’,function(){

console.log("InteractionW/ButtonInt..")

let input = document.getElementById("in")

let para = document.getElementById('p').innerHTML = "Para<T>Activated"

input.addEventListener('input',function (){

    input.getAttribute('Btn')

    console.log(input)

})

})

//
This code can show an output that in console and on them main output chrome explorer. However it is unable to get input and store it and I realized I have no idea about it ?

Your input event listener should be like below

input.addEventListener('input',function (e){
    console.log(e.target.value);
   //or just like below
   console.log(document.getElementById("in").value);
})
1 Like