I am taking a JavaScript course and the instructor gave this as an example the function is called from the .js file:

<input type="text" id="myText" >
<input type="button" onclick="notEmpty()" value="Form Checker" >

function notEmpty() {
var myTextField = document.getElementById('myText');
if(myTextField.value != "")
alert("You entered: " + myTextField.value)
else
alert("Would you please enter some text?") }

I am trying to convert it to accept input

<input type="text" id="myText" >
<input type="button" onclick="notEmpty2("myText")" value="Form Checker" >
(also tried this line w/o the " ") -> <input type="button" onclick="notEmpty2(myText)" value="Form Checker" >

function notEmpty2(chkThis) {
var myTextField = document.getElementById(chkThis);
if(myTextField.value != "")
alert("You entered: " + myTextField.value)
else
alert("Would you please enter some text?") }