try this: if($('#test').next('p').html()=='Hello world!')alert('got it'); 2009/6/3 TeNDoLLA <matti.suuro...@afterdawn.com>
> > I have this code for jquery > $(function() { > $('#test').live('click', function() { > $('#test').after('<p>Hello world!</p>'); > }); > }); > > and this for php part > foreach ($out as $key => $value) > { > $i = 0; > echo $value['name'] . ' : <input id="test'. $i .'" type="text" > name="'. $key .'" /><br>'; > $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. > -- Gustavo Salome Silva