Jquery.css() accepts JSON key:values as properties ?? whats the advantage ?
guys given the following snippet of HTML :
- <div class="doit">Click Me</div>
and the following snippets of Jquery
EXAMPLE ONE
- $(document).ready(function(){
- $('.doit').css({ "color" : "red"});
- });
EXAMPLE TWO
- $(document).ready(function(){
- $('.doit').css( "color" , "red");
- });
BOTH Have the same effect , so whats so efficient about using the 1st method ?? Whats the advantage ??