this is my html dummydiv class=qq33w qqflr qqinrow qq_product_in_list qq_shimmer rel=nofollow div class=qq_inlist_pad a class=shlink div class=qq_product_img_inlist style= div a div class=qq_product_l
To repeat the HTML code 9 times within the class "paging-content", you can use a loop to append the HTML code multiple times. Here's an example using JavaScript:
var htmlCode = '<div class="qq33w qqflr qqinrow qq_product_in_list qq_shimmer" rel="nofollow"> <div class="qq_inlist_pad"> <a class="shlink"> <div class="qq_product_img_inlist" style=""> </div> </a> <div class="qq_product_list_details"> <a href="#"><h3>loading text</h3> <h4> loading text loading text loading text loading text loading text loading text loading text loading text loading text loading text loading text loading text </h4> </a> </div> </div> </div>';
var repeatedHTML = '';
for (var i = 0; i < 9; i++) {
repeatedHTML += htmlCode;
}
$('.paging-content').html(repeatedHTML);
This code creates a variable htmlCode that stores the HTML code you provided. It then loops 9 times, adding the HTML code to the repeatedHTML variable each time. Finally, it sets the html of the element with the class "paging-content" to the repeatedHTML variable, effectively repeating the HTML code 9 times within that element
原文地址: https://www.cveoy.top/t/topic/ilH5 著作权归作者所有。请勿转载和采集!