UNPKG

basic-ui-js

Version:

A lightweight JavaScript library for building web-based applications with simple code. No need to write HTML or CSS — just use basic JavaScript.

43 lines (30 loc) 1.13 kB
<!DOCTYPE html> <html> <head> <title>Input Example</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <!-- LIBRARY FILES --> <link rel="stylesheet" type="text/css" href="basic/basic.min.css"> <script src="basic/basic.min.js" type="text/javascript" charset="utf-8"></script> <script> let inpName; // First running function. window.onload = function() { // INPUT: Your name. Parameters: (left, top) inpName = Input(30, 50, { title: "Your name:", minimal: 1, color: "whitesmoke", }); that.on("input", printName); // events: input, change, focus, paste }; const printName = function(event) { println("Name: " + inpName.text); }; </script> </head> <body> <!-- HTML content --> </body> </html>