jquery - make background green easy as possible -


With jquery, and with a super simple HTML page loaded hquery, I want to make the background green.

No CSS is loaded, just really has the original HTML page and jquery script loaded.

How do I beat the background? The easiest means is to use CSS, link a stylesheet with the following declaration:

/ P>

  html, body {background-color: # 0f0; }   

If you do not want to link to a stylesheet, use it:

  & lt; Body style = "background-color: # 0f0;" & Gt; Use   

or JavaScript:

  document.getElementsByTagName ('body') [0] .style.backgroundColor = '# 0f0';   

or jQuery, if you want to:

  $ ('body'). Css ('background-color', '# 0f0');   

It is worth noting that, if you are ready to include the jQuery library 1 , then you have a proper stylesheet, content and design For a true separation. Even if you only include CSS in the head of the document, instead of specifying the use of jQuery, or style attribute, after that Styles for elements to work more light and easy by developers


1 does not specifically include heavy (especially if it is already cached), about size A small image of an image file, but whenever there is a weight to consider adding your pages together.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -