Groups
Groups
Sign in
Groups
Groups
forumgrouper
Conversations
About
Send feedback
Help
jQuery: click-event-handler for dynamically created a-elements?
0 views
Skip to first unread message
Audrey A Lee
unread,
Aug 20, 2009, 6:46:07 AM
8/20/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to forumgrouper
Hello,
I've been working with jQuery about 20 hours now.
I like it.
I am looking for a demo of putting an a-element inside a div-element.
This seems to work:
$("#div99")[0].innerHTML = "<a id='aInDiv99' href='#'>I am in div99</
a>";
I'd like to handle its click-event.
I wrote this:
$("a#aInDiv99").click(function(event){alert("hello world");});
The click event does not fire when I click 'aInDiv99'
Is there a recipe for writing a click-event-handler for dynamically
created a-elements?
Oh, here is my world:
- jquery-1.3.2.js
- Safari 4.0.3
- Firefox 3.5.2
-Audrey
Reply all
Reply to author
Forward
0 new messages