im newbie in jquery/javascript and got this code below:
$("#result").empty().html(result);
can someone explain the code. correct me if im wrong but i think, it explains that it should empty first before displaying another result in the id of result?
Thank you.
.htmlfunction completely overwrites the HTML anyways.$("#result").html(result);will be enough...emptyandhtml? Is there anything unclear about what the functions are doing? Or are you asking about method chaining works, i.e.foo().bar()? In that case, see how does jquery chaining work?emptyandhtmlare doing and thought you will get a faster answer here than looking the functions up in the documentation?