I use a media query to set the two columns of my table under each other on mobile devices:
One row of the table contains two radio buttons to hide or show other rows (in class "m") in the table:
Function hideM works fine:
However I cannot see how to let the opposite function showM set display to either "block" or "ïnline" depending on the device type.
Code:
@media screen and (max-width:610px) {td,tr {display:block;}}
One row of the table contains two radio buttons to hide or show other rows (in class "m") in the table:
Code:
<tr>
<td>Geeft u machtiging?</td>
<td>
<input type="radio" id="geenmachtiging" name="incassomachtiging" value="GeenMachtiging" onClick="hideM()" <?php if($input['incassomachtiging']=='GeenMachtiging'){echo "checked='checked'";}?>>
<label for="GeenMachtiging">Nee</label>
<input type="radio" id="machtiging" name="incassomachtiging" value="Machtiging" onClick="showM()" <?php if($input['incassomachtiging']=='Machtiging'){echo "checked='checked'";}?>>
<label for="Machtiging">Ja</label>
</td>
</tr>
Function hideM works fine:
Code:
function hideM()
{
const collection = document.getElementsByClassName("m");
for (let i = 0; i < collection.length; i++)
{collection[i].style.display="none";}
}
However I cannot see how to let the opposite function showM set display to either "block" or "ïnline" depending on the device type.