I’m a jQuery beginner and i created a FAQ page.
Code:
index.php
FAQ
1. Question 1
Details1
2. Question 2
Details 2
3. Question 3
Details 3
**script1.js**
$("div").children("p").hide();
$(document).ready(function () {
$("h1").click(function () {
$("div").children("p").hide();
$(this).next("p").show();
});
}
);
Is this correct? Is it look awkward? Any other coding?
Help please.