Tuesday, April 14, 2009

JQuery code for inline edit

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

<span class="editName">Test</span>
<input id="newName" name="editName" style="display: none" type="text" />

<script type="text/javascript">
$(function(){
$("span.editName").click(function(){
$(this).hide();
$(this).next("input#newName").show().focus();
});
});
</script>
</body>
</html>

No comments:

Post a Comment