0

Trying to understand how this "select2" Jquery plugin works.

I know it hides the regular select element and add it's own elements to provide some kind of a dropdown with search experience and when using "inspect element" i see the select2 container and all the other elements but when using view source i don't.

Can some one explain why is it? (Hoping to learn something new :)

Does view source shows only elements that was loaded on the first page load?

Nori
  • 121
  • 8

1 Answers1

0

Ok, so my guess was in the right direction:

View Source shows you only the HTML it received from the server's response. Your JS changes happen afterward.

Firebug and Chrome's debugger show you the source dynamically so you can see the DOM and HTML as it has been changed. But view source will only ever show you what the browser received from the server. (Matt Pileggi - here)

Nori
  • 121
  • 8