html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<title>Lua User Input</title>
<script src="https://cdn.jsdelivr.net/npm/fengari-web@0.1.4/dist/fengari-web.js"></script>
</head>
<body>
<h1>Lua User Input</h1>
<label for="nameInput">Name:</label>
<input type="text" id="nameInput" placeholder="Enter your name"><br><br>
<label for="ageInput" >- Age :</label>
<input type="number" id="ageInput" placeholder="Enter any age"><br><br>
<button onclick="runLua()">Submit</button>
<pre>
</pre>
<div id="output"></div>
<script type="application/lua">
local js = require "js"
local window = js.global
local document = window.document
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
body {
}
h1 {
text-align:center;
color: #aaf;
}
#output {
white-space: pre-line; /* Ensures \n is displayed as a line break */
}
button{
background-color: green;
color: yellow;
border-radius:6px;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Exécuter