I’m trying to change the data-smooth-scroll-offset attribute value for the following div if the screen width is larger than 959px:
This div:
<div id="Table-Of-Contents" data-smooth-scroll="1" data-smooth-scroll-offset="20"></div>
The JS:
function adjustWidth(){
var actual_width = window.innerWidth;
if(actual_width > 959) {
document.getElementById("Table-Of-Contents").data-smooth-scroll-offset="111";
}
}
It appears that data-smooth-scroll-offset is a custom html attribute. Any ideas how to change its value?