Set input value
Description
The following code shows how to set input value.
Example
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(<!--from w w w. j av a2 s . com-->
function() {
$("button").click(
function() {
$(this).next().removeAttr("disabled").focus().val(
"java2s.com now");
});
});
</script>
</head>
<body>
<button>Enable</button>
<input type="text" disabled="disabled" value="can't edit this" />
</body>
</html>