aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Event handlers when using document.createElement() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Event handlers when using document.createElement()" Watch "Event handlers when using document.createElement()" New topic
Author

Event handlers when using document.createElement()

Craig Dumolien
Greenhorn

Joined: Nov 07, 2005
Posts: 20
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

Joined: Jan 10, 2002
Posts: 61661
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

Craig Dumolien
Greenhorn

Joined: Nov 07, 2005
Posts: 20
Sorry about the post being in the wrong topic.

That worked like a charm. Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Event handlers when using document.createElement()