Why only name is changing the color but age is not changing ?
<div id="user">
<?php echo $user_name; ?>
<span class="age"><?php echo $user_age; ?></span>
</div>
user name color chang is working but age inside span is not working.
$(document).ready(function(){
$('#user').css('color','red');
$('#user#age').css('color','gray');
});
try this
you have a class ‘age’ which the selector should start with ‘.’ and it is inside #user, so you need the space between #user and .age .