出於某種原因,我不認爲我的JavaScript不能真正能夠「連接」或鏈接到我的HTML頁面。我試圖甚至把JavaScript放在我的HTML代碼中,但我不知道實際上是什麼錯誤。JavaScript不工作在我的代碼?
繼承人我的代碼:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="practice">
<meta name="keywords" content="practice">
<title>Practice</title>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery_regular.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/jquery.backstretch.min.js"></script>
<script type="text/javascript" src="js/top_javascript.js"></script>
<script type="text/javascript" src="js/jquery_rollover.js"></script>
<script type="text/javascript" src="js/jquery_slideout.js"></script>
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="stylesheet/top_style.css" type="text/css" media="all">
<link rel="shortcut icon" href="favicon.ico" />
</head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("about").hover(function(){
$("about").css("background-color","yellow");
},function(){
$("about").css("background-color","pink");
});
});
</script>
<body onLoad="fontSizeChg(0);">
<div id="top_wrapper">
<!-- Maint -->
<div id="top_main_box">
<div id="slide">
<!-- Main left -->
<div id="top_main_l_box">
<!-- Main left logo -->
<div id="top_main_logo"><img src="image/title.png" alt=""></div>
<!-- Main left Navi -->
<ul id="top_main_navi_1">
<li id="about"> ABOUT </li>
<li><a><img src="image/member.png" alt="" class="rollover"></a></li>
<li><a><img src="image/photo.png" alt="" class="rollover"></a></li>
<li><a><img src="image/links.png" alt="" class="rollover"></a></li>
<li><a><img src="image/contact.png" alt="" class="rollover"></a></li>
</ul>
</div>
<div id="about_this">
This is all the things about our page
</div>
' 「約」'不有效的選擇器。那麼,除非你有' '元素,但它看起來不像你。 –
Javascript現在已經爲您提供了先進的方法......您應該從基本的HTML標記開始,以及如何呈現HTML頁面及其所有項目。訪問這裏 - http://www.w3schools.com/html/html_intro.asp 因爲你的HTML標記是錯誤的,你需要先學習它,下一步將是CSS,然後是JS。 –