how remove a class after an ajax load using jquery?
First thing, I load an html file containing only list information into a ul id of ul_list
$("#ul_list").load("testListResults");
Next, I try to remove all highlight class file:
$("#ul_list li").removeClass("highLight"); // this is not working, still see the list background high light color.
Next, I try to get the text information of the first list.
$("#ul_list li:first").text(); // this is not working either, showing empty.
Add your changes to the call back function. This will ensure the scripts are not ran until the ajax load is complete.
With regards to your second point, I don’t know what you’re trying to do with
$("#ul_list li:first").text();as your not assigning it to a variable, but try.html()instead: