I have a UL with dynamically added LI's. User types in some text into a text input and they click the Add button (or hit enter) and I add an LI with the text and a delete image. I wrote this little function so that the user passes in the text and I create the LI and I call a callback function the user specifies for the click() event of the image element.
And here is how it is used:
I'm just looking for some general improvement suggestions. It literally doesn't need to do more than it does right now. So adding functionality isn't really necessary.
Originally posted by Bear Bibeault: Personally, I tend to rely less on intermediate variables.
I assume you mean the variable creation for text_span, img_span, etc? If so, I thought about this. I for sure need the img instance so I can create the click event. I tried using less but it became a lot less readable. Do you have suggestions? [ August 24, 2008: Message edited by: Gregg Bolinger ]