I have the following
<script>
$(document).ready(function() {
$(".mapLink").click(function(){
pos = $(this).attr("id");
alert(pos);
});
});
</script>
<a class="map" id="test">Test</a>
When I click on Test I get an alert...great. But I also have the following...
<script>
$(document).ready(function() {
$(".mapLink").click(function(){
pos = $(this).attr("id");
alert(pos);
});
});
$(#emp").change(function(){
$("#existingAttendTime").html('');
$.ajax({
url: "existingAttendTime.php?emp=" + SelValue + "&time=0",
cache: false,
success: function(html){
$("#existingAttendTime").append(html);
}
});
});
</script>
<a class="mapLink" id="test">Test</a>
<div id="existingAttendTime"></div>
When the emp changes it fires off and gets the results from existingAttendTime.php and inserts it into the div, so now it looks something like...
<a class="mapLink" id="test">Test</a>
<div id="existingAttendTime"><a class="mapLink" id="12345">Return Test</a></div>
Clicking on Test gets me the alert "test", but clicking on Return Test gets me nothing.
What am I doing wrong or what am I missing?