One of the most powerful things of jQuery is to select any item on a page like this:
$(".block").css("border","3px solid red");
How can I also get the values of the selected items like width height and top left offset?
One of the most powerful things of jQuery is to select any item on a page like this:
$(".block").css("border","3px solid red");
How can I also get the values of the selected items like width height and top left offset?
Try this:
$(".block").css("border","3px solid red").offset().top
$(".block").css("border","3px solid red").offset().left
CSS/offset() in JQuery
Like @Gumbo said yes you can get the height and position. If you are interested in other css attributes you get the value like this:
var border = $(".block").css("border")
But for height and width you are better off using height() and width() functions