User-474980206 posted
they are not exactly the same. if "myinput" is not found, the getElementById().value ttrows an error, while the jQuery version returns undefined.
I seldom use jQuery anymore, but when I do, I like the consistency of the same api (readability) over performance.
if you switch to vanilla js, then use document.getElementById, document.querySelector() and fetch instead of $.ajax()
note: jquery is most helpful if you still support old browsers.