Labels

Friday, August 7, 2015

JQuery Selectors

Today I would talking about Jquery selectorsBefore the evolution of Jquery we would see less developers used to like javascript. Reason, it was difficult to learn and code was lengthy.However Jquery internally uses javascriptMain advantage of using Jquery

Runs across all browsers

Lean and clean

Simple powerful syntax

Highly exentesible

Ajax support

Uses Css selectors

Note: Based on my knowledge the libary has atleast 19 pages of code.

Important syntaxJquery Identifier :$();

Anonymous function

$(function (){
});

Simple selectors$('.classname') : Selects all element within a class

$('.#spaceId') : Selects all element within a Id$('<div>') : Selects all 'Div' element

Hide a Bootstrap Modal using Jquery
("#Id").modal('hide');
I have listed selectors which I feel is helpful .we would have ended up writing lengthy JavaScript code for the same functionality.For more Jquery selectors please refer http://api.jquery.com/category/selectors/