Possible Duplicate:
What does the selector syntax mean in $( “<div/>” ).text( message )
I've searched but couldn't find any info on this... including the jQuery reference...
What does $('<img/>')
mean in jQuery?
I am familiar with $('img')
only.
I have come across this code in this article: http://tympanus.net/codrops/2010/11/16/hover-slide-effect/
But in the code, when I replace one with the other, it stops working, so I guess they are not the same.
Also, the last piece of code:
.attr('src',$this.attr('src'));
what is it for? It seems redudant, but it also fails if I remove it. Can anyone elaborate on this?
Thanks
$(anyHtmlCode)
builds a jQuery wrapped set of elements built from the HTML you provide.From the documentation :
The line
sets the src of $someElement to be the same as those of $this.