Creating div and seeing real time text?

Creating div and seeing real time text?

Hello,

I'm trying to create a div ( which works ) and then add text to it in real time ( which doesn't ).

my code:

  1.          // this part works.
  2. $("#AddText").click(function() {
  3. if (!$('#TextArea').length){
  4. $("#Area").append("<div id='TextArea'>test</div>");
  5. }
  6. });

  7.            // however this isn't working, I can't seem to figure out why.
  8. $("#AddText").keypress(function() {
  9. if ($('#TextArea').length){
  10. $("#TextArea").val(this.value);
  11. }
  12. });

any help would be great.
thanks!