jQuery,Input buttons work in markup, but not when prepended?

Posted by thatryan on Stack Overflow See other posts from Stack Overflow or by thatryan
Published on 2010-03-25T07:38:41Z Indexed on 2010/03/25 7:43 UTC
Read the original article Hit count: 331

Filed under:
|
|

I have to buttons, image input that work fine when in the markup like this,

<input type="image" class="play" src="images/play.png" />
<input type="image" class="pause" src="images/pause.png" />

But as soon as I try to prepend() it to a generated they still appear, but the click function does not work anymore.

$('.gallery-nav').prepend('<input type="image" class="play" src="images/play.png" /><input type="image" class="pause" src="images/pause.png" />');

Any idea why? Thank you.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about prepend