I've been having a problem with the below custom function. I'm trying to access both the jQuery and document object by passing it to the function itself but it doesn't work. I don't understand what is wrong with it. Can you please help?
var MyApp = MyApp || {};
var MyApp = (function(window,document,$){
//private method not returned
var _checkNumbers = function () {
};
var _checkSpecialChars = function () {
};
var _checkWordCount = function () {
};
var _checkRemainingChars = function () {
var myField = document.getElementById("textarea-content");
console.log("id", myField);
};
var stringValidation = function () {
_checkRemainingChars();
console.log("it works");
};
return {
stringValidation: stringValidation
};
})(window,document,jQuery);
MyApp.stringValidation();
This the HTML markup: