検証が失敗したときに、入力タイプのテキストにシェイク効果を与えようとしています。揺れ効果を与えていますが、方向、距離、時間のデフォルト値を変更する方法がわかりません。また、テキストボックスの値を変数aに格納する際に何か間違っていると思います。正しい構文を教えてください。ありがとうございました。
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
$(document).ready(function(){
$("#submitBtn").click(function(){
$a = $("#userNameTxt").value;
if ($a != "text")
{
$("#userNameTxt").effect("shake");
}
});
});
</script>
</head>
<body>
<form action="#" >
<input type="text" name="userNameTxt" id="userNameTxt" placeholder="username" />
<br/>
<input type="submit" value="submit" id="submitBtn" />
</form>
</body>
</html>