-3
<!doctype html>
<html lang="en">
</html>

<head>
    <meta charset="UTF-8">
</head>

<body>

<button>Click Me!</button>
<p>K O N T S</p>

<script src="k.js" type="text/javascript"></script>
<script src="JQuery.js" type="text/javascript"></script>
<script src="JQuery2.js" type="text/javascript"></script>
</body>

</html>

While my JS be like :

$(document).ready(function(){

    $("button").click(function(){

        $("p").fadeOut();

    });



});

This just happened this morning.

The K O N T S won't fade out when I click the Button. Anyone knows why ?

*I've made this code very simple, but still dont get where is my fault(s). *And the stuff also have been placed in a same folder.

Phil
  • 157,677
  • 23
  • 242
  • 245
div7
  • 1
  • 2

2 Answers2

0

Looks like your js files are not referenced properly.

$(document).ready(function(){

    $("button").click(function(){

        $("p").fadeOut();

    });



});
<!doctype html>
<html lang="en">
</html>

<head>
 <meta charset="UTF-8">
</head>

<body>

<button>Click Me!</button>
<p>K O N T S</p>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</body>
</html>
Vim
  • 559
  • 5
  • 16
  • Should I also type ? Because that's the script I wrote for the HTML. – div7 Apr 28 '15 at 04:48
  • Your code should work. Just reference the jquery and other js files properly. Once the page is loaded, go to debugger mode and make sure that all necessary js files are loaded. – Vim Apr 28 '15 at 04:49
  • Tx, Problem solved. Just need to replace the – div7 Apr 28 '15 at 04:57
0

<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
</head>

<body>

<button>Click Me!</button>
<p>K O N T S</p>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).on("ready", function(){
  //Do something with jQuery
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!--<script src="k.js" type="text/javascript"></script>-->
<script>
  var j = jQuery.noConflict();
j( document ).ready(function( $ ) {
  $("button").click(function(){
    $("p").fadeOut();
  });
});
</script>
</body>

</html>
alessandrio
  • 4,282
  • 2
  • 29
  • 40