Getting id and class value of a html element

We have a div and we want to get its id value based on its class value. Suppose a div is given as below and we want to fetch div id based on a button click. for getting attribute id we use attr() method. Example


PHP Final Class

In PHP 5 a new mechanism added in OOPS which is Final Keyword. If a class declares by final keyword then the class never extended. Child class can’t be created of any Final class. It is restrict the overriding a method. Only class and function may be declared as Final but no variable or properties … Read more

Classes and Objects in JavaScript

A class is a set or category of things having some property or attribute in common i.e., car is a class having similar properties such as color, engine, gear, model number etc. The “class” construct allows us to define prototype-based classes. Syntax for declaring a class:

Objects Objects are the instance of classes i.e., … Read more

PHP Abstract Class

Abstract keyword is another new functionality in OOPS. When a class declare by Abstract keyword this class cannot be instantiate. Means if user declares a class as an Abstract class he or she cannot create object of that class. Abstract class is only use for inheriting another class. Main purpose of creating abstract class is … Read more

PHP Class and Objects

Class and objects is a programming template to write a program in a block. It is helps to developer write complex program in simple way, reuse a program in multiple applications and create a structural program. A class has two member one Variables and two Functions. A class is a program structure where developer defines … Read more

Java Classes and Objects

Class A class forms the basis for object-oriented programming. It defines the shape and nature of the object. Any concept that we want to implement in oop’s must be encapsulated within a class. A class is a template for an object and an object is an instance for a class. In another words class is … Read more