can i separate JavaScript If condition?

Posted by Abdulrahman Ishaq on Stack Overflow See other posts from Stack Overflow or by Abdulrahman Ishaq
Published on 2010-05-23T21:00:32Z Indexed on 2010/05/23 21:10 UTC
Read the original article Hit count: 349

Filed under:
|

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>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html