JQuery-Selecting class or ID

JQuery-Selecting class or ID

Hi Guys, I am new to JQuery. I am getting little trouble in selecting an item using class or ID in jQuery?

View Answers

December 4, 2010 at 5:21 PM

Given below code selects an element of id name "element1" :

$('#element1')

Since IDs are unique, so it will select only the element of particular id. Given below code select the elements having particular class name as mention by you :

$('.myClass')

In this case "myClass" is the css class name. The selected elements can have one or more elements.









Related Tutorials/Questions & Answers:
JQuery-Selecting class or ID
JQuery-Selecting class or ID  Hi Guys, I am new to JQuery. I am getting little trouble in selecting an item using class or ID in jQuery
JQuery-Selecting class or ID
JQuery-Selecting class or ID  Hi Guys, I am new to JQuery. I am getting little trouble in selecting an item using class or ID in jQuery... of particular id. Given below code select the elements having particular class
Advertisements
could not find a getter for id in contact class
could not find a getter for id in contact class   could not find a getter for id in contact class
Maven Repository/Dependency: com.github.honoluluhenk.id-class | id-class-jpa-hibernate-integration
Maven Repository/Dependency of Group ID com.github.honoluluhenk.id-class and Artifact ID id-class-jpa-hibernate-integration. Latest version of com.github.honoluluhenk.id-class:id-class-jpa-hibernate-integration dependencies
Difference between class,name,id attributes in each JSP tag
Difference between class,name,id attributes in each JSP tag  Can i know the difference between class,name,id attributes in each JSP tags.................. These 3 are only used for reference ..... And what are the differernces
Maven dependency for com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration version 1.0.1 is released. Learn to use id-class-jpa-hibernate-integration version 1.0.1 in Maven based Java projects
1.0.1 of id-class-jpa-hibernate-integration released The developers of   com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration project... version of  com.github.honoluluhenk.id-class - id-class-jpa-hibernate
Maven dependency for com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration version 0.0.3 is released. Learn to use id-class-jpa-hibernate-integration version 0.0.3 in Maven based Java projects
0.0.3 of id-class-jpa-hibernate-integration released The developers of   com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration project... version of  com.github.honoluluhenk.id-class - id-class-jpa-hibernate
Maven dependency for com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration version 1.0.0 is released. Learn to use id-class-jpa-hibernate-integration version 1.0.0 in Maven based Java projects
1.0.0 of id-class-jpa-hibernate-integration released The developers of   com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration project... version of  com.github.honoluluhenk.id-class - id-class-jpa-hibernate
Maven dependency for com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration version 0.0.4 is released. Learn to use id-class-jpa-hibernate-integration version 0.0.4 in Maven based Java projects
0.0.4 of id-class-jpa-hibernate-integration released The developers of   com.github.honoluluhenk.id-class - id-class-jpa-hibernate-integration project... version of  com.github.honoluluhenk.id-class - id-class-jpa-hibernate
class
class  Is a class a subclass of itself
id
id  how to find date of birth and gender in id in html with the help of javascript
class
is a class to represent a country in medal tally. It has an attribute of country... medals. In this class, you should also define constructors, and assessor, mutator methods. Task 2 MedalTally.java is a class to model a medal tally, containing
Class
Class, Object and Methods       Class : Whatever we can see in this world all the things... is termed as a class. All the objects are direct interacted with its class
Maven Repository/Dependency: com.fommil | class-monkey
Maven Repository/Dependency of Group ID com.fommil and Artifact ID class-monkey. Latest version of com.fommil:class-monkey dependencies. # Version Release Date You can read more
Super class of an Exception class
Super class of an Exception class  hello,,, What is super class of an Exception class?   hii,,ADS_TO_REPLACE_1 the super class of an exception is throwable class. and the super class of an throwable class
Class
Class       This section explores the concept of a class in reference to object oriented programming techniques. A class defines the properties of  objects and methods used
Explain final class, abstract class and super class.
Explain final class, abstract class and super class.  Explain final class, abstract class and super class.   Explain final class, abstract class and super class. A final class cannot be extended. A final class
.class and .tld
.class and .tld  how to create .class and .tld file
class loaders
class loaders   Explain static and dynamic class loaders
class file
class file  How to create class file in jsf easily
inner class
inner class  what is mean by inner class   Inner class is a non-static class which is defined inside another class
Node class
Node class   hii, What is a node class?   hello,ADS_TO_REPLACE_1 A node class is a class that has added new services or functionality beyond the services inherited from its base class
objective c extending a class with a class
objective c extending a class with a class  I need an example for extending a class with a class in objective c. thanks
objective c extending a class with a class
objective c extending a class with a class  I need an example for extending a class with a class in objective c. thanks
Matrix Class
Matrix Class   A class to manage matrices and add them. Create in the driver class two objects of it and use the add method
Matrix Class
Matrix Class   A class to manage matrices and add them. Create in the driver class two objects of it and use the add method
printstrim class
printstrim class  discribe PrintStream class
printstrim class
printstrim class  discribe PrintStream class
lock on a class
lock on a class  hello, Can a lock be acquired on a class?   hiii,,ADS_TO_REPLACE_1 Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object
Java class
Java class  What is the purpose of the Runtime class
immutable class
immutable class  How to make a class immutable
Locale class
Locale class  What is the Locale class
singleton class
singleton class  What is singleton class
Abstract class
Abstract class  Can an abstract class be final
Abstract class
Abstract class  what is an Abstract class
wrapper class
wrapper class  list wrapper class methods
wrapper class
wrapper class  wrapper class methods
robot class
robot class  please send me uses of robot class and some examples using robot class
Nested class
Nested class  What is nested class?  when a class is defined within another class then such a class is called a nested class. Nested... readable and maintainable code. class OuterClass { ... static class
class file
class file  how to convert java classfile into java sourcefile
abstract class
abstract class  Can there be an abstract class with no abstract methods
java.sql.DriverManager class
java.sql.DriverManager class  Why isn't the java.sql.DriverManager class being found
Adapter Class
Adapter Class  Hello Everybody, Can anybody help me to describe what is Adapter class and when to use this class and give a suitable example... visit the following links: What is Adapter Class Example of Adapter Class
create a class
create a class  plz provide any example related to class
super class
super class  which is the super base class in java
wrapper class
wrapper class  why wrapper class does not have a default constructor
Wrapper Class
Wrapper Class  what is wrapper class in java and why we use it   Hi Friend, Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g.
GregorianCalendar class
GregorianCalendar class   hello,, What is the GregorianCalendar class?   hii,ADS_TO_REPLACE_1 The GregorianCalendar provides support for traditional Western calendars
Dictionary class
Dictionary class  hello,, What is the Dictionary class?   hii,,ADS_TO_REPLACE_1 The Dictionary class provides the capability to store key-value pairs
abstract class
abstract class  abstract class AbstractClass{ } is possible and compile the class or any compile time error occur tell me the answer Blockquote

Ads