How to create an EyeDropper tool using JavaScript?