[jQuery] CSS Style Property Assigned by Class
For some reason I cannot get jQuery.css('name') to return a style
property that was assigned by a class. However, it returns the
property if it was assigned by style="". Has anyone else run into this
issue? Bug? Here is my test code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html><head>
<title>CSS Test</title>
<style type="text/css">
.apply-border {
border: 1px solid blue;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/
jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#byStyle').append($('#byStyle').css('border'));
$('#byClass').append($('#byClass').css('border'));
});
</script>
</head><body>
<p id="byStyle" style="border: 1px solid green;">Border applied by
style =
<p id="byClass" class="apply-border">Border applied by class =
</body></html>