From 16d0688ca3a57bebf4b12fa132973c043aa79c51 Mon Sep 17 00:00:00 2001 From: Shubham Juneja Date: Sat, 13 Oct 2018 13:30:47 +0530 Subject: [PATCH] Ex-3 --- exercises/js/sandbox.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/exercises/js/sandbox.js b/exercises/js/sandbox.js index e69de29b..a878da4f 100644 --- a/exercises/js/sandbox.js +++ b/exercises/js/sandbox.js @@ -0,0 +1,25 @@ +//Add five new list items to the end of the unordered list #myList. +div=$('
') +listItem=$('
  • ').html('List item') +for(var i=0; i<5; i++) { + div.append(listItem.clone()); +} +$('#myList').append(div); + + +//Remove the odd list items +$('li:nth-child(odd)').remove() + +//Add another h2 and another paragraph to the last div.module +var heading = $('

    ').text('Hello'); +var paragraph = $('

    ').text('Yes it is.'); +var newDiv = $('

    ').append(heading,paragraph); +$('div.module').last().append(newDiv); + +//Add another option to the select element; give the option the value "Wednesday" +var option = $('