I'm trying to work out if it's possible to detect the change inside a div. With my snippet I'm trying to do an alert when you click click me
but it doesn't work. My understanding from jQuery's docs is that you can attach the change handler to an element.
$( "#target" ).change(function() {
console.log( "change detected" );
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="target"></div>
<span onclick="$('#target').html('changed')">click me</span>