newprog
newprog

Reputation:

I need jQuery advice

I am writing my first project in PHP and I have a problem connected with jQuery.

In my test.html page I have a <div> and in there are 3 buttons, one above the other. When the user clicks the top button, I want a new <div> created under that button with a textbox and one new button (x button). The other 2 buttons must be moved. After clicking x button, everything should return to its initial state.

On the jQuery homepage if you click the “run code” button you will see what I want.

Thanks for any advice.

Upvotes: -1

Views: 103

Answers (1)

Jay
Jay

Reputation: 901

The sample code from the front page:

$("p.neat").addClass("ohmy").show("slow");

What this is doing is referencing the p tag that has a class of "neat", adding a class of "ohmy" (which is likely styled in CSS), and causing the event "show" to happen slowly.

The p tags existed already, and were hidden (likely using a CSS attribute of display:none) and then shown using JQuery.

JQuery has great documentation. I would suggest that you go through some of the tutorials and get a feel for how it works.

JQuery Tutorials

Upvotes: 1

Related Questions