javascript - How to have multiple functions in jQuery ready? -


i can create jquery functions, if want more functions. example wanted have function drop down list , button. can seem 1 function:

<script type="text/javascript">    $(document).ready(function() {       $("button").click(function() {          this.hide();       });    }); </script> <script type="text/javascript">    $(document).ready(function() {       $("banner").click(function() {         this.fadeto();       });    }); </script> 

is right on how create multiple functions in 1 document or there easier way create them? can show me how create multiple ones instead of one?

both functions can go inside same document ready function:

<script type="text/javascript"> $(document).ready(function() {     $("button").click(function() {         $(this).hide();     });     $("banner").click(function()          $(this).fadeto();     }); }); </script> 

however, selector $("banner") invalid, if you're targeting class of banner should $(".banner"), id $("#banner")


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -