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>