I am using jQgrid for doing a table and I want to add an event to a concrete column and I don’t want to pass html with PHP so I want to attach an event and do some work. The problem is that there is no class and no id, I just have this:
<td aria-describedby="list_description" title="lorem ipsum" style="" role="gridcell">lorem ipsum</td>
All the <td />‘s have a aria-describedby, in this case the list_description is where I want to attach an event. In a class way, I’ll do something like $(".list_description").live("click",function(){}); (because is loaded via AJAX) but how I can do it with that custom attribute?
And then, when I click to an area-describedby="list_description" I need to get the value of area-describedby="list_id" that is in the same `.
An example code:
<tr>
<td aria-describedby="list_id" title="1" style="" role="gridcell">1</td>
<td aria-describedby="list_description" title="lorem ipsum" style="" role="gridcell">lorem ipsum</td>
</tr>
<tr>
<td aria-describedby="list_id" title="2" style="" role="gridcell">2</td>
<td aria-describedby="list_description" title="lorem ipsum" style="" role="gridcell">lorem ipsum</td>
</tr>
How I can do it?
Example.
jQuery allows you to search for elements with a given attribute. (
[aria-describedby='list_description']). More about that selector here.