Loading ...

How to make a input field readonly with jQuery | CodeAsp.Net

How to make a input field readonly with jQuery

 /5
0 (0votes)

In this blog I will explain how to make a input field readonly with jQuery.Below is the code snippet:

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head >

<title></title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

</head>

<body>

<div>

<input id="fieldName" name="fieldName" type="text" class="text_box" value="Firstname" />

</div>

</body>

<script type="text/javascript">

$(function()

{

$('#fieldName').attr('disabled', 'disabled');

});

</script>

</html>

 

Happy Reading.!

 

Comments (no comments yet)

Top Posts