首页javascriptinputjQuery Form - 如何淡入输入

jQuery Form - 如何淡入输入

我们想知道如何淡入输入。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<style type='text/css'>
#myField {
  opacity: 0.2;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
    $("#myField").focus(function(event){
        console.log("focus");
        $(this).fadeTo('slow', 3);
    });
});
</script>
</head>
<body>
  <input type="text" id="myField" value="Here is some">
</body>
</html>