im printing out unordered lists dynamically..something like this
$sql2 = mysql_query("SELECT id, todo FROM todo");
while($row = mysql_fetch_array($sql2))
{
$todo1 = $row["todo"];
$todofeed.='
<ul>
<li>' . $todo1 . '</li>
</ul>
';
}
I want each li element that is printed out to be a link for some jQuery effect and for that I need the text inside each li element dynamically i.e. as and when i click on it.Any way around this?
Just add a class to your
<ul>element so that you can access it with Jquery later on:With Jquery manipulate the DOM so that your link is added:
But you could also add the click/hover events on the
lielements. Do what suits you better, your question is not really specific, so hopefully this will give you some ideas.