## Goal ### Configuration UI <img width="640" alt="image" src="https://user-images.githubusercontent.com/6359152/234753905-15d76b75-f1df-4600-91ba-a9f2125d211c.png"> ### Issue I would like to add input event to the input element, but it didn't work and didn't log any thing. The code in the file `configure.phtml`: ``` <script defer="defer" async="async"> 'use strict' console.log('load the openai extension configure page'); (function() { console.log('add output event'); function _addOutputEvent(element) { console.log('element:', element); if (element === null) return; element.addEventListener('input', function() { this.nextElementSibling.value = this.value; console.log(this.id, this.value); }); } _addOutputEvent(document.getElementById('max_tokens')); _addOutputEvent(document.getElementById('temperature')); })(); </script> ``` The output of console: <img width="622" alt="image" src="https://user-images.githubusercontent.com/6359152/234754579-21fbeafc-80b5-47d1-836e-69c28ac7dc87.png"> Appreciate for any help.
Activity
Frenzie commentedon Apr 27, 2023
It would generally be preferred to use appendScript (and depending on security settings inline might not even work).