Skip to content

Instantly share code, notes, and snippets.

@lee2sman
Created October 1, 2022 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lee2sman/21f9dc3cc216f9c0bf4fafcfa34dcaa8 to your computer and use it in GitHub Desktop.
Save lee2sman/21f9dc3cc216f9c0bf4fafcfa34dcaa8 to your computer and use it in GitHub Desktop.
trivial fengari example demonstrating manipulating the DOM with Lua
<!DOCTYPE html>
<html lang="en">
<head>
<title>Fengari test</title>
<script src="fengari-web.js"></script>
</head>
<body>
<script src="main.lua" type="application/lua" async></script>
</body>
</html>
--requires fengari library https://fengari.io/
js = require "js"
local window = js.global
local document = window.document
local body = document.body
body.innerHTML = "<h1>cal</h1><h2>1</h2><h3>hello world</h3><p>hello</p>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment