As the title said, how would I get text from a input tag and show it dynamicly. So whenever i press a, it shows up in a p tag. How would I do this in jQuery?

EDIT: Here is what I have but its not working:


        <title>update text realtime</title>
        <script type="text/javascript">
            update(src) {
                var a = src.value;
                document.getElementById("text").innerHTML = a;



        <input type="text" name="in" onKeyUp="update(this);" />

        <br />
        <p id="text"></p>


<script src="//"></script>

For jQuery commands to work you have to include the library for it in the <head> section of the page.

It would be something like this:

$(function(){ // OnLoad
    $("#MyInputID").keyup(function(){ // Key Up Event
        var val = $(this).val(); // Get value from input
        $("#MyParagraphID").html(val); // Set p html

Thanks guys it works now, but also how would I do this in plain javascript?

You were close...

add the word "function" on line 6 from above.

function update(src) {