<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.6.2.js'></script>
<script type='text/javascript'>
$(window).load(function(){
$(document).ready(function () {
$('.clearButton').click(function () {
$(this).parent().find('input').val('');
})
});
});
</script>
</head>
<body>
<div>
<input type="text" value="John Doe" /> <a href="#"
class="clearButton">clear</a>
</div>
<div>
<input type="text" value="Jane Doe" /> <a href="#"
class="clearButton">clear</a>
</div>
<div>
<input type="text" value="Joe Smith" /> <a href="#"
class="clearButton">clear</a>
</div>
</body>
</html>