How does jQuery get all the values of the same class tag by default

  • 2020-03-30 04:01:58
  • OfStack

We happened to have this problem during development, because jQuery always returns only the value of the first class tag, so it didn't meet our requirements.

Such as:


var btn = jQuery('.btn').val();

Gets just the value of the HTML element with the first class tag BTN.


Related articles: