I have in my form a textarea where some links are stored via the method val():
<li classs="0"><a href="link">Description</a></li>
The textarea should be hidden and I add these links from some other inputs (Link + Description)
For the user to know what he added, I display these links in an unordered list:
<ul id="sources_display">
<li class="0"><a href="link">Description</a></li>
<li class="1"><a href="link">Description</a></li>
<li class="2"><a href="link">Description</a></li>
</ul>
Now I would like to have a remove_link button, which could be as:
<ul id="sources_display">
<li class="0"><a href="link">Description</a><a href="link">Remove Link</a></li>
<li class="1"><a href="link">Description</a><a href="link">Remove Link</a></li>
<li class="2"><a href="link">Description</a><a href="link">Remove Link</a></li>
</ul>
I could do that. But I would like to be able to add this remove link button each time a new link is displayed in the <ul id="sources_display">
. I would like to use something like live()
method.
With other words, do you think it's possible to call a function when something like $("ul#sources_display li")
is displayed during the load of the page or via AJAX request?
THX guys!