I am making an accordian menu.
I just found this link http://jsfiddle.net/zM5Vj/ , and it is almost similar to the accordian menu I have made.
In the code, where there i
Thank You All for responding and helping me in solving it.
@Simon Adcock, Your answer gave me a new way to think about the solution.
However, i also found a 1 line solution to it.
I just added this line to my .js file
$(this).append($('
'))
So, answer finally it is :
if (x == "block") {
$(this).text('');
$(this).append($('
'))
$(this).append(' ' + valueText);
}
else {
$(this).text('');
$(this).append($('
'))
$(this).append(' ' + valueText);
}