how add css to the parent div using jquery

This article gives some basic knowledge about how apply style during DOM Traversal and Manipulation, Event Handling and Ajax.

Html code
<div>
      <a href='javascript:void(0)' class='click'>Add CSS to Parent Div</a>
</div>
DOM Traversal and Manipulation
$( ".click" ).parent().css({'color':'black', 'background-color':'red'})
Event Handling

$( ".click" ).on( "click", function( event ) {

 $(this).parent().css({'color':'black', 'background-color':'red'})

});

Ajax

$( ".click" ).on( "click", function( event ) {

  $.ajax({

    url: URL,

    type: 'GET',

    complete: function (xhr, status) {

  },

   success: function ( data ) {

    $( ".click" ).parent().css({'color':'black', 'background-color':'red'})

   }

 });

});