I would like to be able to have JQuery register an INPUT (ideally any number of INPUT fields) with the DOM once it returns from an AJAX request.

So lets assume the following code is generated AFTER an ajax call to a script that generated it.

JAVASCRIPT:

```
    function save_node()
    {
         alert ( $("#id-edit-node-name").val() );
         //what is the value of my newly created INPUT 
    }

```

Then Some HTML

```
<table cellspacing="0" cellpadding="0" border="0">
<tr>
    <td>Name:</td>
    <td><input type="edit" id="id-edit-node-name" value="this is what should be alerted above... but isn't."></td>
</tr>
<tr>
    <td><button onClick="save_node();">Save</button><td>
</tr>
</table>

```

This is just an example of what I'm trying to do... obviously there are a million ways to get THIS specific issue working, but I'm looking for a scalable method to have many INPUTS returned, with differing ID's, Input Types etc... all depending on state... so if I can get this stub working as intended... I'll be chuffed and owe you a beer if I ever meet you in real-life-land.

UPDATE - Full Code Below... Remember this is being returned by AJAX, so the problem is the ID is not being added to the DOM, thus coming up as undefined...

```
<script>
    function save_node()
    {
        alert ($("#id-edit-node-name").val());

        console.log({

                action      : 'edit_node_go', 
                name:       $("#id-edit-node-name").val(),
                id:         <? echo ( $node->get_data ( 'id' ) ? $node->get_data ( 'id' ) : '0') ?>,
                treeid:     <? echo ( $tree->get_data ( 'id' ) ? $tree->get_data ( 'id' ) : '0') ?>,
                parentid:   <? echo ( $parent->get_data ( 'id' ) ? $parent->get_data ( 'id' ) : '0') ?>

         });

        $.post( "?", {

                action      : 'edit_node_go', 
                name:       $("#id-edit-node-name").val(),
                id:         <? echo ( $node->get_data ( 'id' ) ? $node->get_data ( 'id' ) : '0') ?>,
                treeid:     <? echo ( $tree->get_data ( 'id' ) ? $tree->get_data ( 'id' ) : '0') ?>,
                parentid:   <? echo ( $parent->get_data ( 'id' ) ? $parent->get_data ( 'id' ) : '0') ?>

             },
             function ( data ) {

                                    $( "#dialog-div" ).html ( data );
                                    //$( "#dialog-div" ).dialog ( "close" );

             });

    }

</script>

<table cellspacing="0" cellpadding="0" border="0">
<tr>
    <td>Name:</td>
    <td><input type="edit" id="id-edit-node-name" value="<?=htmlspecialchars($node->get_data ( 'name' ) )?>"></td>
</tr>
<tr>
    <td><button onclick="save_node();">Save</button><td>
</tr>
</table>

```