I am jQuery beginner, and currently i am doing some exercising, on every thing i learn - it's about couple of days i started doing jQuery course.
this is the jsfiddle http://jsfiddle.net/nPcZJ/ example which i am working on,
i was wondering is there a better way to achieve the same result?
however a friend of mine told me if we have got 1000 questions displayed on a particular page and we want to show / hide the answer based on which questions was clicked.
he said that would cause lack of loading the page...?
it seems to be working perfectly with a few questions.
but how about as he said 1000 questions..?
is this really true if i have got 1000 questions that would cause the page not to load...?
$(document).ready(function(){
$("dt").click(function(){
var qst = $(this).parent().find('dd');
$(qst).slideToggle();
})
})
<dl>
<dt>Q-1 What is your favorite scripting language ?</dt>
<dd style="display: none">Ans - PHP, C++ </dd>
</dl>
<dl>
<dt>Q-2 What is your favorite IDE software ?</dt>
<dd style="display: none">Ans - Aptana Studio 3, Dreamweaver</dd></dl>
<dl>
<dt>Q-3 Where are you from ?</dt>
<dd style="display: none">Ans - I am from Russia</dd>
</dl>
<dl>
<dt>Q-4 Can you build small scripts - complex scripts ?</dt>
<dd style="display: none">Ans - Yes, i can build small - complex scripts and from scratch</dd>
</dl>