Explain with an example how to insert javascript in php code.
JavaScript can be inserted by specifying the language as:-
<?
<script language='javascript'>
Code goes here
</script>
?>
Explain with an example how to insert javascript in php code.
Java script can be inserted by embedding <script> tag in a php script as follows:
1) <?
<script language='javascript'>
. . . . . .
</script>
?>
2) <?php
echo" <script language='javascript'>
</script>";
?>
3) <?php
echo <script type="text/javascript">
</script>
?>