-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
33 lines (28 loc) · 815 Bytes
/
main.js
File metadata and controls
33 lines (28 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$(document).ready(function(){
// exercise 1
$('p').on('click', function () {
$(this).hide();
})
//exercise 2
//part 1
$('body').prepend('<div id="newdiv"><h1>Welcome!</h1></div>');
//part 2
$('#ex2').append('<div class="yellow">1st yellow div</div>');
$('#ex2').append('<div class="yellow">2nd yellow div</div>');
$('.yellow').css("background-color", "yellow");
//part 3
$('#hide').on('click', function () {
$('#show_hide').hide();
});
$('#show').on('click', function () {
$('#show_hide').show();
});
//part 4
$('#toggle').on('click', function () {
$('#toggle_text').toggle();
});
//part 5
$('#name').on('click', function () {
$('body').append('<div>Ishana Jabbar</div>');
});
});