So heres my jquery code

$(function() {
        $('#test').live('click', function() {
                $('#test').after('<p>Hello world!</p>');
        });
});

and this is my php part
foreach ($out as $key => $value)
{
        $i = 0;
        echo $value['name'] . ' : <input id="test'. $i .'" type="text"
name="'. $key .'" /><br>';
        $i++;
}

I have unknown amount of input fields with running id. What I try to
achieve is to add the text content under input field when the field is
clicked. And if the text is already added it should not be added
again. So any ideas how to do this?

ps. I am quite jquery/javascript noob.

-TeNDoLLA

Reply via email to