Here is the HTML code I am using:
<td width="15%" align="center"><input name="submit" type="submit" class="button"
value="Basic" tabindex="13"
onclick="return submit_Click('bxbas','bxsht');" /></td>
And below is my JavaScript code:
<script type="text/javascript">
function submit_Click(aclass,bclass) {
var elementsa = document.getElementsByClassName(aclass);
for(i in elementsa)
{
elementsa[i].style.display = "block";
}
var elementsb = document.getElementsByClassName(bclass);
for(j in elementsb)
{
elementsb[j].style.display = "none";
}
}
</script>
However, I'm facing an issue with this setup. It seems that only the first part of the function is working as expected, showing the elements with the class 'aclass'. The second part, which should hide the elements with class 'bclass', is not functioning properly.
If anyone has any suggestions or solutions to this problem, I would greatly appreciate it. Thank you!