Display Input Field Information Simultaneously in <P> tag?

What I’m trying to do is display whatever is typed within an input field simultaneously inside of a <p> tag.

For Example:

If the name Mark is typed into the input field, i would want “Mark” displayed somewhere else on the page inside of a <p> tag and the letters are typed in the input field it displays each etter as its being typed… is this possible?

I know of a jQuery plugin that does this: http://docs.jquery.com/Tutorials:Really_Simple_Live_Comment_Preview

just tested it out it seems to be exactly what im looking for thank you!

double post

why is that inline scripting frowned on?

inline scripting still has its place but it’s generally frowned upon nowadays as part of the higher emphasis on keeping content, styling and functionality as separate as possible.

You can do that with about 3-4 lines max of plain javascript code.

You could put an onkeyup event handler on the <input> which takes the current value of the <nput> and assigns it to the innerHTML property of a <p>.

If you use the now frowned inline scripting, your can do it with a 1 line onkeyup in the <input>. No need for jQuery at all.

I’m going to be using the input field for names, for something as simple as that would you say the jquery method or the onkeyup method would be better to use?

Use whichever you are more comfortable with.

But who knows how much extra code jQuery runs in the background to perform the same task. I suspect it’ll be a lot more lines of code than 3-4 max it would take without jQuery.