Jump to content

EASY FOR YOU (php javascript) !!


Recommended Posts

spirit of my code :

here a button on click for script

here an element <p with id="demodemo"


<script type="text/javascript">
    function myFunction() 
    var abc= "REF1";

    document.getElementById('demodemo').innerHTML =  abc;

        here I need abc
        how ?
        is there 2 methods ?

        thanks for your help




Link to comment
Share on other sites

Javascript cannot pass data to PHP.

PHP runs first on the server, generates Javascript code and then sends that Javascript code to the browser to be executed. If you need any server-side work done after that then you will have to use AJAX. Here is the AJAX tutorial: https://www.w3schools.com/js/js_ajax_intro.asp

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...