
January 21st, 2013, 02:59 AM
|
|
Registered User
|
|
Join Date: Jan 2013
Posts: 1
Time spent in forums: 2 m 14 sec
Reputation Power: 0
|
|
|
jQuery - On change event not fired with dynamically loaded data
I am dynamically loading data in the input type text and triggering alert if the value of the text box is changed. But my code does not seem to work. Please provide suggestions.
<code>
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("input").val("value");
});
function valueChanged()
{
alert("value changed");
}
</script>
</head>
<body>
<input type="text" onchange="valueChanged()">
<p>Write something in the input field, and then press enter or click outside the field.</p>
</body>
</html>
</code>
|