title: How can I apply a jQuery plugin to a JavaScript DOM element?
body: <p>A couple of days ago I had a question about the use of a library called select2,
  that in the official documentation for its installation and use you have to obtain the element through jquery <code>$('.mySelect').select2();</code> my doubt is what it does exactly when you do this action <code>.select2();</code>(in a technical way) to the element and what would be the equivalent action doing it with <code>document.getElementById('mySelect')</code>.</p>