Reputation: 19
I'd like to add into a css property like this
[css]
.someclass some
{
///
}
[jquery]
$('.someclass some').css('behavior','url(path/something/someclass.htc)');
This return an error message as "TypeError:Object Expected"
Upvotes: 1
Views: 631
Reputation: 9570
try this:
$('.someclass some').css({'behavior' : 'path/something/someclass.htc' });
just copying your code for behavior property - you know it should look like this....
$('.someclass some').css({'behavior' : 'url (path/something/someclass.htc)' });
This code will add the css property to the selector in your DOM , if you want to actually change the css file - you can not do that , but you can do this
$('.yourClass').addClass('behavior');
the class .behavior
you put in your css - this will have extra properties , and you dynamically add this class to the elements that you want to have it
Upvotes: 0