While working on editing CSS values of some elements using jQuery, I encountered an issue when trying to change the margin-left value of an element. This resulted in an "Unexpected token" error due to the "-" in margin-left. Is there a way to adjust margins via jQuery without triggering this error?
Here is a snippet from my code:
JS:
$(".settingslist").click(function() {
$(".containcontacts,.containtodolist").css({
display: "none"
});
$(".gChange, .aChange, .yChange, .fChange,.speedChange, .bgChange, .simple, .gClick, .aClick, .yClick, .fClick,.speedSave, #Btn, .gSave, .aSave, .ySave, .fSave ,.bgChange, .fSave,.speedClick,.speedtext,#ImageUrl,.settingstxt,.containweather,#ddbtn").css({
display: "block"
});
$(".gChange, .aChange, .yChange, .fChange,.speedChange, .bgChange, .simple").css({
margin-left:"60px"
});
});
You can access the full program here (I didn't include a snippet as it's not a standalone part of the code): https://codepen.io/Refath/pen/rdZwxE