I have a set of text fields. If text=1 I want a table to be shown otherwise it is hidden. How can I make this in JS and HTML?
Do I have to make the entire code in clien side JS? If I made some of the code in HTML and use a function the table is shown on a new page.
Code:
<script language="JavaScript">
var test1 = document.forside.komp1[document.forside.komp1.selectedIndex].value;
document.write('<table>');
	document.write('<tr>');
	document.write('   <td><input type=text name=t1 >td>');
                document.write('   <td><input type=text name=t2 >td>');

	document.write('</tr>');
	document.write('</table>');
	}
  
if (test1 == 1){
	document.write('<table>');
	document.write('<tr>');
	document.write('   <td><input type=text name=t3 >td>');
	document.write('</tr>');
	document.write('</table>');
	}
</script>