how to move an element to the cursor in javascript

JavaScript
$(document).ready(function() {
  $(this).on("click", function(e) {
    var x = e.pageX;
    var y = e.pageY;
    var el = $("#meh");
    el.css('position', 'absolute');
    el.css("left", x);
    el.css("top", y);
  })
})
Source

Also in JavaScript: