我試圖在單擊按鈕時立即提醒「你好」。我在瀏覽器中得到了上面的錯誤,並且在下面的html中看到,我將腳本鏈接放在按鈕標籤下方,所以我不知道是什麼原因導致了錯誤。任何幫助表示讚賞。TypeError:無法讀取null屬性「removeAttribute」
receiver.js
$(function(){
$("#passform").click(function(){
\t \t alert("hello");
\t \t console.log("hello");
\t });
});
的index.html
<!DOCTYPE html>
\t <html>
\t <head>
\t <link href="public/stylesheets/style.css" rel="stylesheets" />
\t </head>
\t <body>
\t \t <button type="submit" id="passform"></button>
\t <script type="scripi/javascript" src="C:/users/owner/desktop/steelVault/public/javascripts/receiver.js"></script>
\t <script type="scripi/javascript" src="C:/users/owner/desktop/steelVault/public/javascripts/jquery/jquery-2.2.4.min.js"></script>
\t </body>
\t </html>
這可能與AdBlock extenstion有關,如http://stackoverflow.com/questions/38143879/cannot-read-property-removeattribute-of-null-cant-find-source-of-it –