Generation

generate functionWed, 02 Aug 2023

I want to make a panel with a text box and a button to execute and another to delete and another to copy from the clipboard

function createPanel() { var panel = (function() { var elem = document.createElement('div'); elem.style.backgroundColor = '#ff0'; var input = document.createElement('input'); var btExec = document.createElement('button'); var btDel = document.createElement('button'); var btCopy = document.createElement('button'); btExec.innerText = 'Execute'; btDel.innerText = 'Delete'; btCopy.innerText = 'Copy'; elem.appendChild(input); elem.appendChild(btExec); elem.appendChild(btDel); elem.appendChild(btCopy); return elem; })(); document.body.appendChild(panel); } function main() { createPanel(); } main();

Questions about programming?Chat with your personal AI assistant