Ok in this case I ONLY focus on speed.
What is faster?
$('#header').css({'background':'#ff0000','width':'100px','height':'100px'});$('#header').addClass('header');- Just use #header in css
I can’t get the answer by using FireBug.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just use Embedded CSS, that is
#headerin css on our page. If you try to apply CSS using JavaScript, your page may not display correctly if JavaScript on browser is disabled. You may use external CSS file, embedded css on head and the inline CSS.Always give priority to pure HTML and CSS. Trust me, its faster.