<!DOCTYPE html>
<html>
<head>
<script src=”http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.min.js”>
</script>
<script>
$(document).ready(function(){
$(‘#text_hid’).change( function () {
$(‘#text_hid’).val(‘TESTING’);
});
$(‘#bind_btn’). click(function () {
$(‘#text_hid’).trigger(‘change’);
});
});
</script>
</head>
<body>
<h4>Editing value of readonly Text / Binding the OnChange event to Input readonly text</h4>
<input type=’text’ id=’text_hid’ readonly placeholder=”This is readonly text”>
<button id=’bind_btn’>Bind ‘Onchange’ Event</button>
</body>
</html>
Advertisements