I am trying to optimize the code below to be as small as possible (because a client is supposed to just paste it into their website code). Is it possible to minimize it further (i am using minify to compress spaces and stuff but is there any coding i can do to make it smaller?).
<span id="gmbdata"></span>
<script>
function specHours() {
var x = document.getElementById("spec");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
function myFunc(myObj) {
var dag="";var gmbdata="";
for (var i = 1; i <= 7; i++)
{
dag="day"+i;timme="hours"+i;
gmbdata += '<span style="width:15ch;display:inline-block;">'+myObj[dag]+'</span><span style="padding-left:5px;">'+myObj[timme]+'</span><br />';
}
document.getElementById("gmbdata").innerHTML = gmbdata;
if(myObj.specialopeninghours != "") document.getElementById("specialopeninghours").innerHTML = '<a href="#" onclick="specHours()">Speciella öpettider</a><div id="spec" style="display:none"><span>'+myObj.specialopeninghours+'</span></div>';
}
</script>
<script src="https://XXX"></script>