Whats the best way to provide functionality (eg. toggle an 'additional
information' div) when dealing with records with unique id's.

For example lets say we are dealing with product records each one has
a unique id which is a number, so the HTML might look something like
this:

<div class="products">
  <div class="product" id="product_1">
    <p>Name: Red Widget</p>
    <p>Price: 22.00</p>
    <p><a href="">Show description</a></p>
    <p id="description_1" style="display:none;">sadasdasdasdasd</p>
  </div>

  <div class="product" id="product_2">
    <p>Name: Blue Widget</p>
    <p>Price: 24.00</p>
    <p><a href="">Show description</a></p>
    <p id="description_2" style="display:none;">sadasdasdasdasd</p>
  </div>

etc. etc.
</div>

I want to place unobtrusive jquery that will allow the 'show
description' link to display the correct description div...

Many thanks, K.


Reply via email to