Set element's text as a target's value
What I want to do is pretty simple, but I am very new to jquery. I can set text to a div by doing
But what if I want the "This is text" to be replaced by the value currently in a text input? I have tried
$("#target").text("This is text");
and variations but it doesn't work..
I can get what I want by doing this (but it's not very nice)
What should I use instead?