+ 1
How can i make that java will output the content of my input field? Why doesn't my code works?
If i create an input with type=text how can i make that this what im going to write in the input will get outputet with java im i able to make it like this? html: <input id="inpu" type=text></input> output: ________ | | ( <----- input field output with that what i wrote inside the input field: ___________ |hi my name is| javascript: var x = document.getElementById(inpu); document.write(x); and the result i want to have but it won't work ;( : ___________ |hi my name is| hi my name..
2 Respostas
+ 1
You are missing the .value to get the text inside of the element. Without .value you get the whole element.
var x = document.getElementById("inpu").value;
+ 1
oh thank you :DD i needed this so much