Editing value of readonly Text input

<!DOCTYPE html>
<html>
<head>
<script src=”http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.min.js”&gt;
</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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s