Issue 1: I am facing a problem with assigning content to a variable referenced by className, which includes a string in back and an HTML string in link.
var back = "test";
var className = "link1";
var link1 = '<div id="back" class="gohome"></div><div class="link3"></div><div class="link4"></div>';
It seems like the following code is not working as expected
$(className) = className + back;
Issue 2: The code below is not updating the CSS of prevClass variable.
$('[id*="back"]').each(function(){
$('.' + prevClass).css({'left': '-123px'});
$('.' + prevClass).css({'top': '430px'});
$('.' + prevClass).css({'width': '123px'});
$('.' + prevClass).css({'height': '44px'});
<script type="text/javascript">
var back = "";
var prevClass = "start"
var className = "Broken";
start = '<div id="back" class="gohome"></div><div class="link1"></div><div class="link2"></div>';
gohome = '<div class="gohome"></div><div class="start"></div>';
link1 = '<div id="back" class="gohome"></div><div class="link3"></div><div class="link4"></div>';
...
// Include rest of the script code here