> I would like to know how to use jQuery to control (create, delete,
> update, toggle, animate, etc.) divs. I have been searching, but never
> find anything satisfactory.

Can you be more specific?

// create
var $div = $('<div>hello world</div>');

// add to dom
$div.appendTo('body');
$div.prependTo('#otherDiv');

// delete
$div.remove();

// update
$div.html('<h1>goodbye world</h1>');
$div.append('<span>have a nice day</span>');

// toggle
$div.hide();
$div.show();
$div.toggle();

// animate
$div.fadeOut();
$div.fadeIn();
$div.slideUp();
$div.slideDown();

Reply via email to