in PHP we can put HTML between codes like this:
<?php
if (condition) {
?>
<p>True</p>
<?php
} else {
?>
<p>True</p>
<?php
}
?>
can we do this in javascript ? like this ?
<script language='JavaScript'>
if (condition) {
</script>
<p>True</p>
<script language='JavaScript'>
} else {
</script>
<p>True</p>
<script language='JavaScript'>
}
</script>
True
True
` no matter what the condition is (and assuming each of the script blocks were valid, which they're not) – Joe May 23 '10 at 21:07