Handle text input change event
Description
The following code shows how to handle text input change event.
Example
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.6.js'></script>
<script type='text/javascript'
src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>
<link rel="stylesheet" type="text/css"
href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css">
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){<!--from w w w . j a v a 2 s . c om-->
$('#mytextbox').change(function() {
console.log('Hello World!');
});
$('#mysearchbox').change(function() {
console.log('Hello World!');
});
});//]]>
</script>
</head>
<body>
<div data-role="page" id="p1">
<div data-role="header">
<h1>Header Page 1</h1>
</div>
<div data-role="content">
<a href="#p2" data-role="button">Go To Page 2</a>
</div>
<div data-role="footer">
<h4>Footer</h4>
</div>
</div>
<div data-role="page" id="p2">
<div data-role="header" data-rel="back">
<h1>Header Page 2</h1>
</div>
<div data-role="content">
<p>This is page2</p>
<input type="text" id='mytextbox'></input> <input type="search"
id='mysearchbox'></input>
</div>
<div data-role="footer">
<h4>Footer</h4>
</div>
</div>
</body>
</html>