Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Event handlers when using document.createElement()

 
Craig Dumolien
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create textarea objects on the fly. Below is the code I'm using to do that. However, I also need to use the events onkeydown and onkeyup to implement a textarea counter, of 250 characters. How/Can do I add the event handlers to my createElement code?

var textarea = document.createElement('TEXTAREA');
textarea.setAttribute('name', 'headerNote');
textarea.setAttribute('id', 'headerNote');


Thanks for the help.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

This post has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Craig Dumolien
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about the post being in the wrong topic.

That worked like a charm. Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic