jQuery double click event

jQuery double click event example for COMP1021

by scsswil

HTML

<p>When the paragraph ic clicked on it will turn green.</p>
<p>Click on me</p>

JavaScript

$(document).ready(function() {
  $("p").dblclick(function() {
    $(this).css('background-color', 'green');
  });
});