I have a form section that deals with text inputs named options.
By default i'm providing two options. I want to add one more option field when last one is clicked.
<input type='text' name='options[]' class='options'>
<br/>
<br/>
<input type='text' name='options[]' class='options'>
i tried
$(".options:last").click(function(){
$("#options").append("<br/><br/><input type='text' name='options[]' class='options'>");
})
It does work the first time. But doesn't work after that. It doesn't considers the input that were added by jquery. So it works only when i'm clicking the 2nd option. Not the last one added by jquery. How to do that?