Why is if ($(this) == clickedObject) not working?
i wrote
- $(document).ready(function ()
- {
- var clickedObject;
- $('.knob').mousedown(function ()
- {
- clickedObject = $(this);
- });
- $(".knob").mousemove(function (event)
- {
- if ($(this) == clickedObject)
- {
- console.log("test");
- }
- }
- });
It doesn't work, it doesn't recognise the two objects as being the same. When I log both $(this) object and the clickedObject to the console, they look pretty much exactly the same to me.
Am i missing something obvious here?