Pass a DIV ID to a self-defined function in JQuery

Pass a DIV ID to a self-defined function in JQuery

Hi all,

I am writing a simple html in which when the user moves his mouse over a particular DIV,
a message box will pop up.

Part of the code is as follows:

  1. <DIV id="1">Hide them</DIV>
  2.   <p>Hiya</p>
  3.   <p>Such interesting text, eh?</p>
  4.   </td></tr></table>
  5. <script>
  6.     $("#1").mouseover(function () {
  7.       $("p").hide("slow");
  8.     })   
  9.     $("#1").mouseout(function () {
  10.       $("p").show("slow");
  11.     })   
  12. </script>
I want to make the code re-useable, but dont know how to modify it.
Let's think the case that there are a few more links in the HTMl file,
and then I got to write the same script again.

How is it to modify the script above to do the same result as the following example:
  1. <DIV id="1" onClick="function(this.value)">Hide them</DIV>
  2.   <p>Hiya</p>
  3.   <p>Such interesting text, eh?</p>
  4.   </td></tr></table>
  5. <script>
  6. function(divID){
  7. if(divID){
  8. divID.mouseover.show();
  9. else
  10. divID.mouseout.hide();
  11. }
  12.          }
  13. </script>
I dont know how to pass a DIV's ID to a self-defined function in JQuery.

Could you help me out please?