DEV Community

Ruxin Qu
Ruxin Qu

Posted on • Updated on

jQuery

  • $(event.currentTarget).val(); can get the value from form elements.
  • .change() method can be used among <input>,<textarea> and <select>. It triggers an event when the value is changed with a mouse.
  • .addClass(className) and .removeClass(className) both don't have a period inside the parenthesis.
  • $('#id').animate({},time) the first parameter is an object containing the css properties.
  • $(this) inside the event handler doesn't need to run the second DOM query.
  • parent.append(child) will add the child to the parent
  • $('target').attr('id', 'value_of_your_id') add an id to the target
  • slim jQuery doesn't have JQuery UI

Top comments (0)