Introduction to mutual passing of values between js and php. JS is the front-end language, PHP is the background language, and the front and back-end are often unclear at the beginning (I did it at the beginning, and now I am also committing a crime ), my original idea was to regard the former JS as the front-end language, and PHP as the background language. at the beginning of the year, there may often be situations where the front-end and back-end cannot be clearly identified (I did this at the beginning, at the same time, I used to think of the frontend and backend as two islands. they cannot cross. HTML is like a bridge, when you want to transfer the variable from one island to another, you only need to use this bridge.
Let me make a small summary:
1: How to upload the values in HTML to JS? The following is a file named 1.php.
The code is as follows:
JS, if you want to get the name value entered by the user in the text box, write
The code is as follows: