/**
@author : Shubham Maurya,
Email id : maurya.shubham5@gmail.com
**/
Hi all , Welcome to shubhammaurya.com , Today we are going to discuss ,
How to Call a JavaScript Function from PHP using echo
1.Make a file in notepad and save it as index.php and paste the below code.
/** @author : Shubham Maurya, Email id : maurya.shubham5@gmail.com **/ Hi all , Welcome to shubhammaurya.com , Today we are going to discuss , how to Call HTML JavaScript Function from PHP using echo 1.Make a file in notepad and save it as index.php and paste the below code. <?php echo "<script> window.onload = function() {move();}; </script>"; ?> <!DOCTYPE html> <html> <head> <style> #myProgress { width: 100%; background-color: #ddd; } #myBar { width: 10%; height: 5px; background-color: #4CAF50; text-align: center; line-height: 30px; color: white; } </style> </head> <body> <p id='myP'></p> <script> function move() { document.getElementById("myP").innerHTML = "Successfully Invoked."; } </script> </body> </html> </html>
Find Code at github : click here
STAY CONNECTED FOR MORE
Nice code. Please keep mi updated via my mail. Thanks
Sure..!! Soon i’ll give the subscribe button
Now, you can Subscribe to Our Posts.