Class Selector

PHOTO EMBED

Sat Nov 16 2024 03:02:58 GMT+0000 (Coordinated Universal Time)

Saved by @login123

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Select Element by Class</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
$(document).ready(function(){
    // Highlight elements with class mark
    $(".mark").css("background", "yellow");
    $(".markfont").css("color","blue");
});
</script>
</head>
<body>
    <p class="mark">This is a paragraph.</p>
    <p class="mark">This is another paragraph.</p>
    <p class="markfont">This is one more paragraph.</p>
</body>
</html>
content_copyCOPY