I want to apply multiple CSS properties and values using a single JQuery method,
like this :
selector.CSS('property1': 'value1', 'property2': 'value2');
This method is not working, tell me how it is possible?
My Code is:
$('.myclass').css('background-color': 'red', 'color': 'white');
To use multiple CSS properties and values using a single JQuery method use following code:
$('.myclass').css({'background-color': 'red','color':'white'});
If you still have a question about this, submit it in our Q&A community - Ask Question