I’m a novice in JQuery, I’m trying some simple code but not getting the desired out put on browser. Here is my code:
<head>
<title>Product</title>
<script type="text/javascript" src="../../Scripts/jquery-1.5.1-vsdoc.js"></script>
</head>
<body>
<script type="text/javascript">
$('p').css('color','#red');
</script>
<p>
This is for test, supposed to show in red!!
</p>
</body>
What I’m doing wrong? I used firefox to observe the result. Thanks in advance.
You try to work with dom when it is not built. In jQuery there is a standard event handler for that:
Updated: Also as here was mentioned you should use
redinstead of#red, because#is used for hex codes of colors.