AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
The jQuery mousedown()
and mouseup()
events automatically wired up an (anonymous) function to the
javascript mousedown() and mouseup() properties of the selected element.
Click on each of these alerts.
//jQuery method
$("#alert1").mouseup(function () { $("#demo1").html("pressing down in well 1"); });
$("#alert1").mousedown(function () { $("#demo1").html("releasing button in well 1"); });
//Javascript method
document.getElementById("alert2").addEventListener("mouseup", function () { document.getElementById("demo1").innerHTML = "pressing down in well 2"; });
document.getElementById("alert2").addEventListener("mousedown", function () { document.getElementById("demo1").innerHTML = "releasing button in well 2"; });