Say I've created a jQuery reference to a form tag ($formRef), and within the form I am dynamically adding and removing DOM elements.
Will these selectors, a & b, reference the same element?
var a = $formRef.find('#elementAddedPostFormReferenceCreation');
var b = $('#elementAddedPostFormReferenceCreation');
I've always believed that with dynamic HTML, the DIV containing the dynamic content should not be cached because it will only 'find' the elements that existed when the reference was created. But I've been testing and this idea is proving to be incorrect.
I have a number of hidden divs in a form, and I am using insertAfter to display them, dynamically, in a particular order.
So I have a for loop and an array of div id's, and I call insertAfter within the loop. Is there a way to insert the divs one at a time, so that div1 for example slides down, then div2 slides down after div1 is in place? I've looked at queue and animate, but I have not gotten them to work correctly. Although the order is correct in the function below, everything happens all at once rather than consecutively.