0

The concept of my script is

  1. show a textarea.

  2. when I start giving input to the textarea, it'll show the second textarea.

  3. In the same way, when I start to input sometext in the second textarea, it'll show the other one and so on.

html :

<div id="question">
    Question 1:<br />
    <textarea rows="7" cols="72"></textarea>
</div>

javascript :

var num = 1;
$('#question').keyup(function(){
    num++;
    $('#question').append('
                    <br />Question '+num+':
                    <br /><textarea rows="7" cols="72">
                    </textarea>');
});

the problem :

when I input some word on textarea1, it shows textarea2. but, when I input word again on textarea1, it will show a different textarea.

can any one please help me? I don't get the idea for checking on my javascript.

Thank you

1
  • Curious who downvote this question? Commented Jun 29, 2011 at 5:16

1 Answer 1

4

Try this, just a simple demo, http://jsfiddle.net/kCtHn/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.