Here's what I am trying to do in (jquery,html):
The aim is to make it so that when I hit the switch (basic/advanced) a block of html is added to the existing html. Within this new block there will be another switch (less/more) which should added another block.
However I can't seem to (less/more) switch to work. In fact the function is not running at all.
The function that corresponds to the (basic/advanced) switch is:
var selectInvestment = "basic";
function expandInvestment(){
$("input[type=radio][name=expandInformation]").click(function(){
selectInvestment = $(this).val();
var huge = 'huge block of html code in here';
if(selectInvestment == "advanced"){
$('.investmentBlock').empty();
$('.investmentBlock').append(huge);
expandedExpenses();
} else if(selectInvestment == "basic"){
$('.investmentBlock').replaceWith("<...more html code...>");
}
});
}
And it's similar for the less/more switch.
Here is jsfiddle preview. http://jsfiddle.net/1g6uraht/1/