December 16, 2016

Javascript vs Jquery


  • jQuery in itself is written in JavaScript.
  • JavaScript was first appeared on 1995 while jQuery was initially released in August 26, 2006.
  • JavaScript is an Object Oriented Programming (OOP) language while jQuery is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML.
  • JavaScript is a scripting language that works with all web browsers while jQuery is only a framework that is a fast and concise JavaScript library that simplifies the HTML document.
  • In case of using JavaScript you are required to writer your own script that can be time consuming. In case of using jQuery you are not required to write much scripting that already exists in libraries.
  • JavaScript is combination of both ECMA script and DOM while jQuery has DOM.
  • JavaScript has many processes in creating web-based applications while creating a web-based application with the help of jQuery has become easier.
  • Animations are not possible using JavaScript while these can be easily created using jQuery
  • jQuery support only Firefox, Google Chrome, Safari, Opera, and Internet Explorer while JavaScript is supported by all major web browsers without plug-ins.
javascript Jquery
function changeBackground(color) {
   document.body.style.background = color;
}
onload="changeBackground('red');"
$('body').css('background', '#ccc'); 
document.getElementById("example") $('#example')
document.getElementsByClassName("example") $('.example')
document.getElementById("btn")
.addEventListener("click", function () {
    document.getElementById("txtbox").value = "Hello World";
});
$('#btn').click(function () {
    $('#txtbox').val('Hello World');
});

No comments: