jsceryをscript.jsとして保存したjsフォルダに入れて、自分のhtmlでファイルを呼び出しようとしています。だから私は私のCSSの前に、私のCSSの後にそれを呼び出そうとしました。誰でも自分の問題を特定できますか? DOMが使用可能であるとき、ここに私がjqueryはhtmlに含めても実行していません
<!DOCTYPE HTML>
<html>
<head>
<?php include '/php/db.php'; ?>
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script type = "text/javascript" src="js/script.js"></script>
<link href="https://fonts.googleapis.com/css?family=Josefin+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Paprika" rel="stylesheet">
<title>YFC</title>
</head>
<body>
<div id = "container" method="post">
<div class="signup">
<h1>Sign up</h1>
<form action="/action_page.php">
<input class="pop" type="text" name="Sname" placeholder="Fill in your name!"><br><br><br>
<input class="pop" type="password" name="Slastname" placeholder="Fill in your last name!"><br><br><br>
<input class="pop" type="text" name="Susername" placeholder="Fill in your username!"><br><br><br>
<input class="pop" type="password" name="Spassword" placeholder="Fill in your password!"><br><br><br>
<input class="pop" type="password" name="SRpassword" placeholder="Repeat your password!"><br><br><br>
<input class="sbutton" type="submit" value="Submit">
</form>
</div>
<div class="signin">
<h1>Log in</h1>
<form action="/action_page.php" method="post">
<input class="pop" type="text" name="Lusername" placeholder="Fill in your username!"> <br><br><br>
<input class="pop" type="password" name="Lpassword" placeholder="Fill in your username!"> <br><br><br>
<input class="lbutton" type="submit" value="Log in">
</form>
</div>
</div>
</body>
</html>
そして、ここに私のindex.phpに私のscript.jsを呼び出そうとしましたどのように私のjqueryのコードは
ある$('.pop').mouseenter(function(){
$(this).css('width',300);
});
$('.pop').mouseleave(fucntion(){
$(this).css('width',280)
});
をこの '$(ドキュメント).ready(関数(){の内側には、コードラップしてみてください}) ' –
ブラウザのコンソールにはどんなエラーがありますか? – j08691