#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    119
    Rep Power
    0

    Jquery function not working


    Why Jquery function is not working but window.onload is working correctly .. what is going on :/ even I have change the name of JS directory but it is still not working except window.onload. Please help

    Code:
    <html>
    <head>
    	<title>PHP Form Testing</title>
    
    <style type="text/css">
    
    body{
    	padding: 5px;
    	font-family: sans-serif;
    	color: green;
    }
    
    .baba{
    	color:red;
    	font-family: arial;
    }
    
    
    </style>
    
    <script src="www/js/jquery-3.2.1.min.js"></script>
    
    <script>
    window.onload = function() {
     
         alert( "welcome" );
     
     };
    
    $(document).ready(function() {
    	$('.ddt').addclass('.baba');
    });
    
    </script>
    
    </head>
    <body>
    <h1 class="ddt">This is Test Form</h1>
    <button id="btn">Button</button>	<br><br>
    
     <form action="test.php" method="post">
    
     <label>Name :
     <input type="text" name="name">
     </label><br><br>
    
     <label> Password :
     <input type="password" name="pw">
     </label>
     <br><br>
     <input type="submit" name="submit">
    
     </form> 
     
    
    
    </body>
    </html>
    
    
    <?php
    
    if(isset($_POST['submit'])){
    	echo "form submitted";
    }
    ?>
  2. #2
  3. Maddening Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,453
    Rep Power
    9645
    "addclass" and "addClass" are not the same thing.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    119
    Rep Power
    0
    I have changed to addClass, but still not working
  6. #4
  7. Wiser? Not exactly.
    Devshed God 2nd Plane (6000 - 6499 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    6,123
    Rep Power
    4103
    Are you certain that www/js/jquery-3.2.1.min.js is the correct path to the jQuery library?

    Check your browsers developer console (F12) for error messages to tell you what the problem is.
    Recycle your old CD's



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    119
    Rep Power
    0
    Originally Posted by kicken
    Are you certain that www/js/jquery-3.2.1.min.js is the correct path to the jQuery library?

    Check your browsers developer console (F12) for error messages to tell you what the problem is.
    I got it now .. it was some sort of glitch :/ .. I tried it over Internet Explorer and it worked and now it is working over Google Chrome.
    Thanks dude for repllies

IMN logo majestic logo threadwatch logo seochat tools logo