if you're use mta browsers yes you can
try this example
JS
function onEvent(event) {
if (event == "test") {
console.log("Test event triggered!")
mta.triggerEvent("myLuaEvent", "arg1", "arg2") // trigger lua event
else if (event == "test2") {
// more stuff
}
}
Lua
executeBrowserJavascript(browser, "onEvent('test')")
addEvent "myLuaEvent"
addEventHandler("myLuaEvent", browser, function(arg1, arg2, ...)
print(arg1, arg2, ...)
end)
Don't forget to set development mode to web
setDevelopmentMode(true, true)
Then type /debugscript 3
use html forms