Using jQuery add the class "w3r_font_color" and “w3r_background” to the last paragraph element
- جي كويري
- 2021-09-16
- mhanasmh00489829403
الأجوبة
HTML Code :
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Add two classes to the matched elements.</title>
</head>
<body>
<p>PHP</p>
<p>Java</p>
<p>Python</p>
</body>
</html>
CSS Code:
p {
margin: 8px;
font-size: 16px;
}
.w3r_font_color{
color: blue;
}
.w3r_background {
background: orange;
}
JavaScript Code :
$( "p" ).last().addClass( "w3r_font_color w3r_background " );
القوائم الدراسية التي ينتمي لها السؤال
معلومات ذات صلة