So as said in last question i was making some console shet for my other stuff and got into some problems
i wanted to get string from input to variable to split it but it does not get anything, it's clear :\
this was my variable code
var args = consoleInput.value.split(/(\s+)/)
and then i wanted to see it using console log like this
console.log(args)
but output is this
>[""]
And nothing else
JS:
const consoleInput = document.getElementById("input");
var args = consoleInput.value.split(/(\s+)/)
console.log(args)
HTML:
<div class="inputTextDiv">
<span id="inputText"></span><br>
</div>
<input type="text" placeholder="Insert Command ;P" id="input">
inputText.valueto get the contents of the text box.var args = inputText.value.split(/(\s+)/)Uncaught TypeError: Cannot read property 'split' of undefined at main.js:26inputTextisnull, meaning that there's no element in the DOM with that id.