Does hashnode widget support Javascript


1 min read

First let's make a simple widget named `alert`:

console.log('hello from widget');

let count = 0;

function click_button(){
    let str = `click button from widget ${++count} times`;
    document.getElementById("demo").innerHTML = str;
button {
    padding: 5px 10px;
<p id="demo"></p>
<button onclick="click_button()">click to alert</button>

Then add it to article:


It's proven that Javascript is allowed but alert function doesn't work. Can you see an alert dialog?