jquery how is $(this) really stored? -


see this basic example:

<div id="cont">    <input type=button value='button'>   </div> <input type=button value='button'>  

and script:

$('input').click(function(){     console.log($(this));     console.log($('#cont').has($(this)));     console.log($('#cont').has($(this)).length);     console.log("---");     });​ 

in both button-click value of $(this) according console.log same:

[<input type=​"button" value=​"button">​]  

why give still different results?

in other words information not represented when console log $(this). information may points element unique id. it, stored? why not showed in log?

it looks it's same since buttons have same markup.

edited example


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -