我想在焦点上更改 html 中文本框的颜色。但我的颜色没有改变。!
html
<!DOCTYPE html>
<html>
<head>
<title>Make a new account</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="script.js" type="text/javascript" ></script>
</head>
<body>
<h2 align="center" class="Heading">Want an account</h2>
<h3 align="center" class="Heading">Enter your details</h3>
<div align="center">
<form name="Info_Form">
<table>
<tr>
<td class="TD">Your Name Pal :</td> <td><input type="text" name="Name"></td>
</tr>
<tr>
<td class="TD">Your Password :</td> <td><input type="password" name="pwd"></td>
</tr>
<tr>
<td align="right" ><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
我的.js文件:
$(document).ready(function(){
$('h2').fadeOut(3000);
$(".TD").focus(function(){
$(this).css("background-color","blue");
});
});
我究竟做错了什么?