Dynamically create div and its ID, and print out ID?

< script type= "text/javascript" >

          
            function createDiv(divNum)
            {
                for(var k=0;k<divNum;kPP){
                    console.log(k)
                    $(".info").append("<div id="div"+k+>"+"div"+"</div>");
                } 
                $.each($("div"),function(){
                alert($(this).attr("id")
                
                )});
            }
            // console.log(1)
            
            createDiv(3);
            console.log(5)
        </script>       
        IDiddiv
Apr.02,2021

$('.info'). Append ('< div id= "div' + k +'>'+" content of div is empty "+'< / div >');


because there is something wrong with the nesting of your quotation marks

$('.info').append('<div id="div' + k + '">' + 'div</div>');

function createDiv(divNum)
            {
                for(var k=0;k<divNum;kPP){
                    console.log(k)
                    $('.info').append(`<div id="div${k}">div</div>`); // 
                } 
                $.each($("div"),function(){
                alert($(this).attr("id")
                
                )});
            }
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e6a0-2c43c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e6a0-2c43c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?