I've been trying to figure out the proper syntax for the pure JavaScript version of this JQuery code.
$('body').css('margin-bottom', $('footer').height());
So far what I have is:
var body = document.getElementById('#body');
var footer = document.getElementById('#footer');
body.style.marginBottom = footer.style.height;
This assignment only works if I define the footer height in JavaScript.
I'm aware of this question How to make a pure javascript .css() function using variable variables [duplicate] and the questions similar to it, but still am unable to get it correct. I know I could just use JQuery, but I don't see the value in loading a whole library to do very simple things.
Thank you in advance.