During user search, the search results must be dynamically loaded and displayed, so those html elements must be dynamically generated by Ajax. When the user opens the search interface, the system recommends users. When the user searches by condition, the search results are dynamically loaded and displayed. Therefore, JavaScript is used for this purpose. This for loop removes existing forms. Then, a new form object is dynamically generated based on the data in the Ajax request. Be sure to pay attention to the j variable from large to small loop. Otherwise, after the div element is deleted, serchResultLenth = serchResult. children. length; length changes (this problem has been explored for a long time before it can be done, remember)
For (var j = serchResultLenth-1; j> = 0; j --) {var serchChild = document. getElementById (serchResult. children [j]. id); serchResult. removeChild (serchChild );}