How to create my own jQuery-like function?
Take a look at my code below. As a procedure to get better and learn advanced Javascript coding I am trying to create my own JQuery-like element selector. I have various attempts to get as close to the original jQuery Syntax, but it's just not right. To change the inner HTML of the element with the ID "myID" jQuery works like this: $("#myID").html("blah blah blah"); The notation that looks most similar is as follows: new $("myID").chtml("blah blah blah"); I tried different things, but I just can't get rid of the "new" keyword. As far as I know jQuery is written in pure JS, so there has to be a suitable solution for the problem. I looked at the source code at code.jquery.com, searched for "$", but it's way too much for me. Could someone help me out here? What am I doing wrong, where do I think in the wrong direction? Any hints, tips or help highly appreciated. THANK you in advance Pete. https://code.sololearn.com/WcUGUoEXphhS/?ref=app