mirror of
https://github.com/hexahigh/games.git
synced 2025-12-11 20:15:38 +01:00
a
This commit is contained in:
parent
af7542f851
commit
b95c122693
@ -1,11 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
<script src="index.js" defer></script>
|
||||
<body>
|
||||
<textarea id="textInput"></textarea>
|
||||
<button id="processButton">Process</button>
|
||||
</body>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
<script src="index.js" defer></script>
|
||||
|
||||
<body>
|
||||
<textarea id="textInput"></textarea>
|
||||
<button id="processButton">Process</button>
|
||||
<h3>Output</h3>
|
||||
<textarea id="myTextarea"></textarea>
|
||||
<button onclick="addArrayToTextarea()">Add Array to Textarea</button>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -1,11 +1,19 @@
|
||||
const textInput = document.getElementById("textInput");
|
||||
const processButton = document.getElementById("processButton");
|
||||
|
||||
var inputText = "NaN"
|
||||
var lines = "NaN"
|
||||
var modifiedArr = "NaN"
|
||||
|
||||
processButton.addEventListener("click", function () {
|
||||
const inputText = textInput.value;
|
||||
const lines = inputText.split(/[\n\r]+/);
|
||||
inputText = textInput.value;
|
||||
lines = inputText.split(/[\n\r]+/);
|
||||
console.log(lines);
|
||||
const arr = ['first', 'second', 'third'];
|
||||
const modifiedArr = arr.map(i => '"' + i + '",');
|
||||
modifiedArr = linus.map(i => '"' + i + '",');
|
||||
console.log(modifiedArr)
|
||||
});
|
||||
|
||||
function addArrayToTextarea() {
|
||||
const textarea = document.getElementById("myTextarea");
|
||||
textarea.value = modifiedArr
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user