I am a javascript noob, so apologies if this question is not for this forum. I am trying to understand jQuery method:
e.preventDefault()
In the code below, when moving items form one list to another it is needed for us to be able to move the items. I would like to know what exactly is happening there and what default action are we preventing from happening?
$('#move').click(
function(e) {
$('#list1 > option:selected').appendTo('#list2');
e.preventDefault();
});
$('#moveAll').click(
function(e) {
$('#list1 > option').appendTo('#list2');
e.preventDefault();
});
$('#removeAll').click(
function(e) {
$('#list2 > option').appendTo('#list1');
e.preventDefault();
});