<style>
x-field{
display:inline;
position:relative;
}
x-field .close {
position:absolute;
padding:0 5px;
right:0;
}
</style>
<x-field>
<input type="text" onmouseover="javascript:this.focus();" id = "text">
<span class="close" onclick="this.previousElementSibling.value = ''">
×
</span>
</x-field>
<style>
x-field{
display:inline;
position:relative;
}
x-field .close {
position:absolute;
padding:0 5px;
right:0;
}
#text:hover {
border-color: red;
}
</style>
<x-field>
<input type="text" onmouseover="javascript:this.value='q'" id = "text">
<span class="close" onclick="this.previousElementSibling.value = ''">
×
</span>
</x-field>