mirror of
https://github.com/Sneed-Group/frontend-js-example
synced 2024-10-30 00:17:58 +00:00
Add 'index.js'
This commit is contained in:
parent
119e5e4ead
commit
0eb3c9557f
1 changed files with 18 additions and 0 deletions
18
index.js
Normal file
18
index.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>FrontendJS Example</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="http://nodemixaholic.com:3002/nodemixaholic/frontend.js/raw/branch/main/frontend.js"></script>
|
||||
<script>
|
||||
clearPage()
|
||||
let firstH1 = createElement("h1", "h1-1")
|
||||
writeText("h1-1", "Hello, world")
|
||||
createParagraph("paragraph1", `This is an example of how to properly use Frontend JS.
|
||||
Also it's a test if things are working.`)
|
||||
let dino = createButton("dino", "dino sound")
|
||||
changeAttributes(dino, {"onclick": "playAudio(`https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3`, 0.4)"})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue