I have a 'test.html' and a 'test.php' files.
The 'test.html':
<html>
<head>
<script type="text/javascript" src="/js/jquery-1.8.2.js"></script>
</head>
<body>
<p>Hello</p>
</body>
</html>
<script type="text/javascript">
$(function() {
$("p").on('click', function() {
$(this).load("test.php");
$(this).off();
});
});
</script>
<script type="text/javascript">
$(function() {
$("#sel_1").on('change', function() {
alert("SELECT changed!");
});
});
</script>
And the 'test.php':
<?php
echo "<select id='sel_1'>";
echo "<option>one</option>";
echo "<option>two</option>";
echo "<option>three</option>";
echo "</select>";
?>
When i click the 'p' item (Hello), then the jQuery load a new content into 'p'.
But when i change a select item, I would like to see the alert messages, but it will not appear. How can I solve this?