Blog

How jQuery Selectors can make your process easy with quick response

  • March 27, 2014
  • admin
  • JQuery
  • No Comments

jQuery is a very strong JavaScript library generally used for DOM manipulations. As the name suggests ‘Query’ you can query(traverse) the DOM and do the manipulations. jQuery is a very powerful JavaScript platform that brings DOM manipulations handy with just few lines of code.wholesale jerseys Though its just a wrapper to plain JavaScript but, undoubtedly it enhances its powers and gives flexibility and that too with a small snippet of code. JQuery mainly plays around using ‘selectors’. Selectors can be looked upon as a ‘query’ i.e. based on the selector it queries(selects) elements from the DOM and returns as jQuery object. It should be noted that, when matched elements are more than one then what is returned by jQuery is array of objects. I have filtered out some of the common though important selectors that you may find useful.You can find a complete list of selectors on official site of jQuery. jQuery(“*”) cheap jerseys Selects all the elemtns in DOM, returns array of jQuery objects. jQuery([name|=”value”]) Will select elements which has ‘name’ attribute and its value is either equal to or starts with ‘value’ followed by (-) jQuery([name*=”value”]) In this case jQuery will search for elements which has ‘name’ attribute and value of that attribute contains ‘value’ in it jQuery([name=”value”]) Will select elements which has ‘name’ attribute and its value is equal to ‘value’ jQuery(“.class”) Will select all the elements with ‘class’ class. jQuery(“ancestor descendant”) One of the most cheap nfl jerseys powerful and useful selectors amongst all. This selects elements considering the specified hierarchy for e.g : jQuery(‘div label span’); will find all the ‘span’ elements that are in the specified hierarchy i.e. all the span elements that have label as their immediate parent and that label has a div as its immediate parent. This selector generally helps conflict less DOM element selection. Here is a link for your reference: http://api.jquery.com/category/selectors/

About The Author

admin

NCode Technologies Inc. is a rapidly growing leader among web design & web development company India. In the current scenario, marketing strategies of companies have turned to the web for their expansion and diversification needs, and have reaped the optimum benefits.

Related Posts