[jQuery] apply function
[jQuery] apply function
Hi everyone,
I have a problem with jquery script.. I have this script :
$(document).ready(function() {
$('select[@name=menu]').change(function() {
$('#diff').html('<a class="test">click here</a>');
});
$('.test').click(function() {
alert('haha');
});
});
And the html is below :
<select name="menu" class="textfield">
<option>One</option>
<option>Two</option>
</select>
The problem is, when the anchor 'click here' has appeared (if I select
one of the option), the pop-up window won't shown, if I click the
anchor.
But, if I add the html script like this, below the option :
<a class="test">just click</a>
that anchor can show up the pop-up window..
Can anyone help me with this problem? thank you very much...