(5) JQuery Error Spotting Questions and Answers

  1. There is no error.

  2. .toggleClass() should be replaced with .addClass().

  3. .siblings() should be replaced with .siblings(".btn").

  4. .removeClass("active") should be replaced with .removeClass().

View Answer
  1. There is no error.

  2. .get() should be replaced with .ajax().

  3. .fail() should be replaced with .error().

  4. .fail() should be replaced with .catch().

View Answer
  1. There is no error.

  2. top: '+=150px' should be replaced with bottom: '+=150px'.

  3. The duration 1000 should be in quotes: "1000".

  4. The callback function should be inside quotes: function() { ... }.

View Answer
  1. There is no error

  2. "li" should be replaced with "ul li".

  3. .siblings() should be replaced with .children().

  4. .addClass("selected") should be replaced with .toggleClass("selected").

View Answer
  1. There is no error.

  2. "text" should be replaced with 'text'

  3. .val("Hello World!") should be replaced with .text("Hello World!")

  4. .val("Hello World!") should be replaced with .html("Hello World!")

View Answer