[jQuery] bug in jquery ? css('border') returns undefined
I wonder why this doesn't work, either it's a but or a flaw in the documentation:
consider this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
<html>
<head>
<style type="text/css">
h1 {
background-color: #FF00FF;
color: white;
border: 1px solid red;
}
</style>
<script type="text/javascript" src="../jquery.latest.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var mycss = $('h1').css('border');
alert("hi : " + mycss );
});
</script>
</head>
<body>
<h1>hello world</h1>
</body>
</html>
...
mycss returns undefined instead of '1px solid red'
Unless there is a good reason that i'm unaware of, this seems like a bug to me, no ?
Thanks
Alexandre