Automatically getting DIV's ID?

Automatically getting DIV's ID?

Hello!

I have a <ul><li> menu with links named #p1, #p2, #p3 etc.

Below I have divs named #p1_c, #p2_c etc. linked to menu items. How to write one function for it to work if I have to use a href="#"?

For now I have:

  1. $(document).ready(
    function()
    {
    $("#p1").click(
    function()
    {
    $("#p1_c").show("slow");
    });
    });