Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$("#someDiv").attr("scrollHeight") not working in jquery-1.6.1

$("#someDiv").attr("scrollHeight") works in jquery 1.3.2 for all browsers. But on updating to jquery 1.6.1, it only works in IE9. Firefox 4.0.1, Google Chrome 11 and Safari 5 all return undefined. $("#someDiv").get(0).scrollHeight however still works for all browsers.

Anybody knows what is going on?, is attr("scrollHeight") broken in the newest jquery (i.e version 1.6.1)?

like image 291
adentum Avatar asked May 31 '11 23:05

adentum


1 Answers

jQuery 1.6 introduced .prop and changed the meaning of .attr.

Read all about it.

(Always worth checking the documentation first; the page for .attr talks about this too.)

like image 128
Lightness Races in Orbit Avatar answered Sep 22 '22 03:09

Lightness Races in Orbit