Attached to input element:
input
Source
Attached to readonly input with appended button:
Attached to div element:
div
markup:
js: