I assume that you are attached to search input using jQuery handlers per se. So just pass in the type of event. For more information, pass the entire event object:
$("input.Search").click(function(event) { doMySearch(this, "click"); }).keyup(function(event) { doMySearch(this, "keyup"); }); function doMySearch(element, eventtype) { ... }
Raynos
source share