$(document).ready(function () {

    // 
    $('.add_row').click (function(){
        const node = $(this).data('node')
        let content = $(node).html()
        const rand= Math.round(Math.random()*100).toString()
        // alert(rand)
        const matched= content.match(/RAND/g)
        console.log({matched});
        const res= content.replace(/RAND/g, rand)
        console.log(res);
        $(node).before('<div class="mb-5 row">'+res+'</div>')
    })

    $('body').delegate('.delete_row', 'click' ,function(){
        $(this).closest('.row').remove()
    })
})