Reputation: 2074
I have an ajax function and I want on success
to change CSS for some HTML elements, in the success
I did :
success:function(d){
$('#name').css('weight','normal');
$('#msg').css('weight','normal');
$('#date').css('weight','normal');
}
But It won't work.
When I do this :
success:function(d){
alert('some thing');
}
It worked.
so I think the problem is from the code I used in the success
function.
Upvotes: 0
Views: 104
Reputation: 3106
font-weight is the correct property name.... Also you can mention all selectors in single line since operation is same..
Use this code...
$('#name, #msg, #date').css('font-weight','normal');
Upvotes: 0
Reputation: 82231
It should be:
success:function(d){
$('#name').css('font-weight','normal');
$('#msg').css('font-weight','normal');
$('#date').css('font-weight','normal');
}
Upvotes: 1