+ 1
Can any one tell me how to write JavaScript code inside the php code ?
4 Answers
+ 5
JavaScript code can't be written inside <?php ?> element. So, close that element (i.e. add the end tag ?>) at first. Then add <script> element and write JavaScript code inside it.
Edit: JavaScript code can be embedded inside <?php ?>. Check @WASP's answer.
+ 5
But this works: https://code.sololearn.com/w0Hk9V4EOSMo/?ref=app
+ 4
Thank you dab and wendy seijas.
+ 1
I have written that too but it isn't working . can you help in any other way .