Template
1
0

added dom

This commit is contained in:
2025-11-20 17:25:11 +03:00
parent 50443223cd
commit 864bbef52d
353 changed files with 7926 additions and 2542 deletions

View File

@@ -0,0 +1,18 @@
//wait until page is ready
$(document).ready(function() {
//sets <a> element within paragraph to yellow
$("p").click(function(){
$(this).children("a").css("background-color", "yellow"); /* returns all the <a> child elements that are
within this paragraph*/
});
// Toggle the visibility of the paragraph when a button is clicked
$("button").click(function(){
$(this).prev().slideToggle('slow');
});
// Open the paragraph once the image is clicked
$("img").click(function() {
$(this).next().children("p").slideDown();
});
});