Jquery index in relation to other elements
===

I was wondering if it possible to find the index of an element in relation to the number of elements with the same class, and if so how would I go about doing this?

So if I have the following...

    <div class="container">
        <p>This is content 1</p>
        <p>This is content 2</p>
        <p>This is content 3</p>
    </div>

        ...other HTML

    <div class="container">
        <p>This is content 1</p>
        <p>This is content 2</p>
        <p>This is content 3</p>
    </div>

And you click on an item in the first container it will return index 1, but if you click on an item in the second container it will return index 2 because it is the 2nd div with the class 'container'.

Is this possible? If so how can it be done? 

Thanks very much for any help.