- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 766 Articles for JQuery
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
242 Views
The $.proxy() method in jQuery is used to take a function and returns a new one that will always have a particular context.SyntaxThe syntax is as follows −$(selector).proxy(context, name)Above, the context parameter is the name of object where the function can be found, whereas the name parameter is the existing function whose context will be changedExampleLet us now see an example to implement the jQuery $.proxy() method − $(document).ready(function(){ demo = function(){ this.txt = "Object property!"; $("p").click($.proxy(this.myClick, this)); }; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
124 Views
The #id selector in jQuery is used to select the element with the particular id.SyntaxThe syntax is as follows −$("#id")ExampleLet us now see an example to implement the jQuery #id selector − .one { color: white; background-color: blue; } $(document).ready(function(){ $("#demo").addClass("one"); }); Car Details Car: Chevrolet Equinox 4-link rear suspension Automatic Emergency Braking Fuel Tank Capacity: Approx 14.9 gal OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
414 Views
The [attribute!=value] selector in jQuery is used to select each element that isn’t having the specified attribute and value.SyntaxThe syntax is as follows −$("[attribute!='value']")ExampleLet us now see an example to implement the jQuery [attribute!=value] selector − .one { color: white; background-color: orange; font-size: 16px; border: 2px blue dashed; } $(document).ready(function(){ $("p[class!='demo']").addClass("one"); }); Car Details Car is XUV500 2179 cc Independent Suspension Fuel Tank Capacity: 70 litres OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
111 Views
The .class selector in jQuery is used to select all elements with the specific class.SyntaxThe syntax is as follows −$(".class")Above, the parameter class specify the class of the elements.ExampleLet us now see an example to implement the jQuery .class selector − .one { background-color: blue; color: white; font-size: 18px; border: 2px blue dashed; } $(document).ready(function(){ $(".demo").addClass("one"); }); Heading One Heading Two Demo text 1... Demo text 2... Demo text 3... Demo text 4... OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
104 Views
The :visible selector in jQuery is used to select elements that are currently visible.SyntaxThe syntax is as follows −$(":visible")ExampleLet us now see an example to implement the jQuery :visible selector − $(document).ready(function(){ $("p:visible").css("color", "red"); }); Heading One Heading Two Demo text 1... Demo text 2... Demo text 3... Demo text 4... OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
181 Views
The :text selector in jQuery is used to select input elements with type text.SyntaxThe syntax is as follows −$(":text")ExampleLet us now see an example to implement the jQuery :text selector − .one { background-color: green; color: white; font-size: 15px; border: 2px blue dashed; } $(document).ready(function(){ $(":text").addClass("one"); }); Fill the Form Username: Set Password: Reserved: Unreserved Products: Accessories Clothing Footwear Electronics Books Submit OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
252 Views
The :submit selector in jQuery is used to select button and input elements with type submit.SyntaxThe syntax is as follows −$(":submit")ExampleLet us now see an example to implement the jQuery :submit selector − .one { background-color: green; color: white; font-size: 18px; border: 2px blue dashed; } $(document).ready(function(){ $(":submit").addClass("one"); }); Fill the Form Username: Set Password: Reserved: Unreserved Products: Accessories Clothing Footwear Electronics Books Submit OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
110 Views
The :selected selector in jQuery is used to selects option elements that are pre-selected.SyntaxThe syntax is as follows −$(":selected")ExampleLet us now see an example to implement the jQuery :selected selector − .one { background-color: green; color: white; font-size: 18px; border: 2px blue dashed; } $(document).ready(function(){ $(":selected").addClass("one"); }); Fill the Form Username: Set Password: Reserved: Unreserved Products: Accessories Clothing Footwear Electronics Books Submit OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
141 Views
The :root selector in jQuery is used to select the document's root element.SyntaxThe syntax is as follows −$(":root")ExampleLet us now see an example to implement the jQuery :root selector − $(document).ready(function(){ $(":root").css("color", "red"); }); Heading One Heading Two Demo text... OutputThis will produce the following output −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
177 Views
The :reset selector in jQuery is used to select button and input elements with type reset.SyntaxThe syntax is as follows −$(":reset")ExampleLet us now see an example to implement the jQuery :reset selector − .one { background-color: blue; color: white; font-size: 18px; border: 2px blue dashed; } $(document).ready(function(){ $(":reset").addClass("one"); }); Register Username: Set Password: Reserved: Unreserved Submit OutputThis will produce the following output −