1
What I want to do is when the width
page is less than the value shown below it enters data-tablesaw-mode="stack
on the site shown below! I am new in JavaScript
but I need this for a project! Thank you to whom I help I am available to provide any information that is important.
What I intend to insert
data-tablesaw-mode="stack"
Like I’m trying to do
<script>
var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
var table = document.getElementsById('table-hide');
if width<39.9375em {
table. += "data-tablesaw-mode="stack";
}
</script>
HTML where I want to insert
<table id="table-hide" class="tablesaw tablesaw-stack">
Open to use Jquery?
– I_like_trains