[jQuery] How to deal with running id fields?
I have this code for jquery
$(function() {
$('#test').live('click', function() {
$('#test').after('Hello world!
');
});
});
and this for php part
foreach ($out as $key => $value)
{
$i = 0;
echo $value['name'] . ' : <input id="test'. $i .'" type="text"
name="'. $key .'" />
';
$i++;
}
So I have input fields with running ID's. The question is how can I
get the text added under the field that was clicked ? And if it has
already been added it should not add the text again.