I would like to know if this is correct to set the bottom css using javascript:
var productElement2 = document.getElementsByTagName("footer");
productElement2.style.bottom=="0"
I ask this because my script does not work :p.
Thanks for the feedback :). If this is correct something else might be wrong but I just want to be sure.
Use the
=operator for assignment. The==operator is for comparison.Note: If the value is a non-zero value, it needs a unit. Example:
Also, as kinakuta pointed out, the
getElementsByTagNamereturns an array of elements, so you have to get one elements from the array. If you only have one footer, just get the first element: