-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanipulating.js
27 lines (21 loc) · 909 Bytes
/
manipulating.js
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
/* global $,document */
class ExerciseManipulate {
constructor() {
}
manipulatingFun() {
//#1 //Add five new list items to the end of the unordered list #myList.
$("#myList").append("<li>List item 8</li>", "<li>List item 9</li>", "<li>List item 10</li>", "<li>List item 11</li>", "<li>List item 12</li>");
//#2 //Remove the odd list items
$("#myList li:even").remove();
//#3 //h2 and another paragraph to the last div.module
$("div#specials").append("<h2>New Heading Tag</h2>", "<p>New Paragraph Tag</p>");
//#4 // option to the select element; give the option the value "Wednesday"
$("select[name]").append("<option value=Wednesday>Wednesday</option>");
//#5 //
$("img[alt]").first().clone($("div#specials").after("<div></div>"));
}
}
$(document).ready(function () {
var obj = new ExerciseManipulate();
obj.manipulatingFun();
});