How do I get the border-radius from an element using jQuery?

Posted by S Pangborn on Stack Overflow See other posts from Stack Overflow or by S Pangborn
Published on 2010-05-24T22:38:43Z Indexed on 2010/05/24 22:41 UTC
Read the original article Hit count: 207

Filed under:
|
|

I've got a div, with the following HTML and CSS. In an attempt to make my Javascript code more robust, I'm attempting to retrieve certain CSS attributes from the selected element.

I know how to use the .css() getter to get elements, but how to get the border-radius using that method?

jQuery's documentation is sparse.

HTML:

<div id="#somediv"></div>

CSS:

#somediv {
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
}

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html