PDA

View Full Version : anyone know what is this javascript function??


fattat
07-30-2009, 02:07 AM
anyone know what is this javascript function??
would it influence the input function??
the code is getting from this website
http://www.reindel.com/spruce_search_box_css/
can i delete it from my code??



<script language="javascript" type="text/javascript">
$(function() {
swapValues = [];
$(".swap_value").each(function(i){
swapValues[i] = $(this).val();
$(this).focus(function(){
if ($(this).val() == swapValues[i]) {
$(this).val("");
}
}).blur(function(){
if ($.trim($(this).val()) == "") {
$(this).val(swapValues[i]);
}
});
});
});
</script>