//Sample solution to script.js
$('document').ready(function() {
$('#changeButton').click(function() {
//note:
//the div containing both 'lineJumper'
//and 'lineLeaver' has the id 'line'
var $divIDline = $('#line');
var $divIDlineJumper = $('#lineJumper');
var $divIDlineLeaver = $('#lineLeaver');
//move the div with id 'lineJumper'
//to be the first child of 'line'
$divIDlineJumper.prependTo($divIDline);
//move the div with id 'lineLeaver'
//out of the line (make it a sibling of the line)
$divIDlineLeaver.insertAfter($divIDline);
});
});
No comments:
Post a Comment