jquery lab program 3

3. Using jQuery add a new class to an element that already has a
class
Aim: To add a new class to an element that already has a class
using jQuery.

Exercise3.html

<!DOCTYPE html>
<html>
<head>

<style type="text/css">
.w3r_background{

background-color: skyblue;

}
.w3r_font_color{
color:red;

}
</style>
<title>Excercise - 3</title>

<script type="text/javascript" src="jquery-
3.1.1.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){

$('p:last-of-type').addClass('w3r_font_color');

});
</script>
</head>
<body>
<p>

P.V.K.N. Govt. College was established in 1961 in Chittoor Andhra Pradesh on the sprawling campus far
from the madding crowd of 112 acoes.
</p>
<p>
The College is afliated to Sri Venkateswara Universityr Tirupati.. It has been accredited with ‘A’ grade by
the NAAC with 3.02 CGPA in the yeao 2017.

</p>
<p class='w3r_background'>
It has been fulfilling the aspirations of the marginalized
sections of the society of the Chittoor region by imparting value
based education and employability skills since its inception.</p>
</body>
</html>

output:-

P.V.K.N. Govt. College was established in 1961 in Chittoor Andhra Pradesh on the sprawling campus far from the madding crowd of 112 acoes.
The College is afliated to Sri Venkateswara Universityr Tirupati.. It has been accredited with ‘A’ grade by the NAAC with 3.02 CGPA in the yeao 2017.
It has been fulfilling the aspirations of the marginalized sections of the society of the Chittoor region by imparting value based education and employability skills since its inception.

Comments

  1. The main motive of the Automated big data engineering is to spread the knowledge so that they can give more big data engineers to the world.

    ReplyDelete

Post a Comment

Popular posts from this blog

6.Create a help file as follows using frameset concept

2. Illustrate font variations in your HTML code.

jquery lab programs 1&2