jQuery - getting attribute values from an Ajax element

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
EPX
Forum Newbie
Posts: 19
Joined: Fri Nov 21, 2008 3:22 am
Location: Stafford, UK

jQuery - getting attribute values from an Ajax element

Post by EPX »

Hi all,

I know I'm probably missing something really simple, but i hope you can help.

I have a page which generates some hidden input boxes via Ajax when a particular button is pressed. I then want to press another button and get jQuery to pull out the value of the hidden input boxes, but i'm hitting the problem that the newly generated elements are not part of the original loaded DOM elements so they are not acknowledged by jQuery.

I know about the .live() which listens for events such as clicks and mouseovers, but has these are hidden elements and they are not going to have events happen to them.

Does anyone know how to allow jQuery to see these hidden elements?

As i said, i'm sure i have missed something really simple here, but you help is much appreciated.

Thanks
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: jQuery - getting attribute values from an Ajax element

Post by pickle »

The fact that they're hidden elements doesn't matter. The event will be fired by the button being clicked anyway.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply