I have created a custom plugin to Node-Red Editor to add my tab to sidebar.
I referred:
I have two files in plugin: testplugin.html
I have created a drop down list like this:
var x = document.createElement("SELECT");
x.setAttribute("id", "mySelect");
document.body.appendChild(x);
var z = document.createElement("option");
z.setAttribute("value", "css");
var t = document.createTextNode("CSS");
z.appendChild(t);
document.getElementById("mySelect").appendChild(z);
testplugin.js
In js I am having HTTP listener like this:
On getting any data on /chatgpt I want to update my drop-down list which I created in HTML file dynamically.
You already have the done callback in your call to the /chatgpt API endpoint, that is where you update your drop-down. You should also include a fail callback so that you can notify the Editor when the call fails for whatever reason.
Yes, that is true.
But when I am trying to do access that dropdown in js file, it is not able to do so.
I tried : document.getElementById("id of dropdown");