Embed code to html component from item in database

Can anyone help with the code required ?

Hi Eldhose.

iPlease read the following article.
https://support.wix.com/en/article/corvid-working-with-the-html-element

You can query you’re collection using wix-data and after that embed it to the html code.
Moreover i added for you a simple example of how to transfer messages between your wix web page and you’re html component.



//corvid code
$w.onReady(function () {
    $w('#modifyHtmlButton').onClick(()=>{
        $w('#htmlComponent').postMessage({variable:"10"});
    })
});
    

    

//html component code
<!DOCTYPE html>
<html>
<head>

<meta charset="UTF-8">
<title>Title of the document</title>
<style>
body{
background-color: white;
}
</style>
</head>
<body>
Content of the document......
<p class="paragraph">this text will change after you click my wix button</p>
<script>
window.onmessage = (event)=>{
    if(event.data){
        document.querySelector('.paragraph').innerHTML =         
        event.data.variable;
    }
}
</script>
</body>
</html>