For those of you who are interested in creating you own wordpress plugin, or want to become a web application developer, you certainly will need jQuery when it comes to create cool graphics and images for your application. jQuery is one of the most powerful javascript libraries you can find nowadays. The most important reason web application developers choose jQuery is because it can be used in any web browsers nowadays without changing the coding as compared to javascript which we will need to write different version of javascript for users that use different types of web browsers. Another reason why jQuery is so attractive to the web developers is that it will not increase the web page loading time which is so important for any website nowadays because those visitors will certainly not happy with a website which takes too long to load due to those images or videos on it, and when it comes to SEO, Google SE will also dislike those websites with longer loading time as well, and with jQuery, the visitors will see the webpage first instead of waiting for those images from the site to get fully loaded. Therefore, jQuery is a very good tool to use if we are dealing with those web design that involve javascript.
Below is a simple example showing you how to change the background color of a page element by using jQuery. Basically, when you want to change the background color of that element inside the <p> tag, let say changing that background color to red, all you need to do is adding the following jQuery script within the head tags of that webpage just like how you did it with the normal javascript
<head>
<script type=”text/javascript”>
$(function(){
$(“p.first”).addClass(“rd”);
});
</script>
follow by css
<style>
p.first {
font-weight: bold;
}
p.rd {
background-color: red;
}
</style>
</head>
<body>
<div>
<p class = “first”>Hi</p>
</div>
</body>
and that is it! Simple huh! Basically what this script does is just adding the red color background to the class=”first” page element within the <p> tags with some css plus a few line of simple jQuery script. If you do not understand the above jQuery script, don’t worry about it because I am going to show you some more jQuery coding from time to time and I believe you will master it very soon because jQuery is not that hard to understand, javascript is harder.
