Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamjuneja11 committed Oct 25, 2018
1 parent 9144ed1 commit ef00bb1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions exercises/js/sandbox.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
//Add five new list items to the end of the unordered list #myList.
div=$('<div>')
listItem=$('<li>').html('<span>List item<span>')
for(var i=0; i<5; i++) {
div = $('<div>');
listItem = $('<li>').html('<span>List item<span>');
for (var i = 0; i < 5; i++) {
div.append(listItem.clone());
}
$('#myList').append(div);


//Remove the odd list items
$('li:nth-child(odd)').remove()
$('li:nth-child(odd)').remove();

//Add another h2 and another paragraph to the last div.module
var heading = $('<h2>').text('Hello');
var paragraph = $('<p>').text('Yes it is.');
var newDiv = $('<div>').append(heading,paragraph);
var newDiv = $('<div>').append(heading, paragraph);
$('div.module').last().append(newDiv);

//Add another option to the select element; give the option the value "Wednesday"
var option = $('<option>').text('Wednesday').attr('value','Wednesday');
var option = $('<option>').text('Wednesday').attr('value', 'Wednesday');
$("select[name='day']").append(option);

//Add a new div.module to the page after the last one; put a copy of one of the existing images inside of it.
var newDiv = $('<div>').addClass('module').append($('img').get(0));
$("div.module").last().after(newDiv)
$("div.module").last().after(newDiv);

0 comments on commit ef00bb1

Please sign in to comment.