Jquery Selector worked Once and Not working Again. "All Selector "

+6 Ezubelu Anthony · June 11, 2015
I wrote an external jquery code selecting an  ID on an Onclick event, and it works and stopped. then i change its ID to a class and it worked again and stopped. right now, is no longer working. my jquery and javascript are well linked. and my jquery is working, because i tested it using inline and its still working. below are my codes.

<body>
<script type = "text/javascript" src = "http://<?php echo $_SERVER['HTTP_HOST'].'/Trice/TriceMall/Customer/Scripts/javascripts/signup-login.js'; ?>"> </script>

            <script type = "text/javascript" src = "http://<?php echo $_SERVER['HTTP_HOST'].'/Trice/TriceMall/Scripts/jQuery/jQuery.js'; ?>"> </script>

 <div id = "signup-login-button">
                 <table>
                        <tr>
                            <td>
                                <button type = "submit" size = "30" class = "button-login" id= "login-home-button">Login</button>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                  <button type = "submit" size = "30" class = "button-login" id = "signup-home-button">Sign Up</button>
                            </td>
                        </tr>
                 </table>
            </div>


</body>

MY SCRIPT CODE IS AS FOLLOWS:

$('#login-home-button').click(function(){
  
     $('#login-home-button').hide();

  });

please i need serious help. i have a project to complete. 

Post a Reply

Replies

- page 2
Oldest  Newest  Rating
0 Ezubelu Anthony · August 3, 2015
Any Help Still
0 Ezubelu Anthony · August 28, 2015
still waiting
0 Marco Schindler · September 6, 2015
Please describe how it is supposed to work.

For me it is doing what it is supposed to do.
Hide the Login button on click.

If I reload the page I can hide it again.

http://codepen.io/anon/pen/OyPqGx

Please further describe your issue.
  • 1
  • 2

Javascript

106,992 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators