I have a list that is populated with 4 items. Within each list item I have a label containing a down arrow. I have given this label a css class = 'downControl'
I want to hide the down arrow on the last item in the list. To do this I use jquery in the page load event to set the css on the downControl to display:none. Here is the code:
var lastDown = $(".downControl").last();
lastDown.css("display", "none");
To my surprise it hides the down arrow on ALL 4 list items. I then run another script to give me a count of the number of downControls:
var n = $(".downControl").length;
alert('There are ' + n + ' downControls');
This tells me there is only 1 downControl. I am guessing that the load event can only see the list control BEFORE it is populated with values.
My question: is there another event I can put the code into? I really need to run the script AFTER the page has loaded (and the list has been populated with values) instead of while it is loading. I have tried most of the other events. Is there another solution to this?
Thanks for your help.