You can directly do that in the JavaScript. Just get the value of the input type in JavaScript using id and show it using .innerHTML.
No. PHP runs on the server. It receives a http request from the web server, and sends output (typically as html) to the browser. Any code in an onclick event would be handled by javascript. To send data back to the webserver (and PHP) you can make a synchronous request (AJAX) from an onclick, or any other browser event.
PHP is a server-side language, meaning that the code is executed on the server rather than on the user's local machine. Because of this, it doesn't matter what platform the user is using. In simple terms: User opens their browser -> Browser sends request to server -> Server executes code -> Output is sent back to the browser
It depends on what browser you're using. If you're using IE, then you have to go to View->Source to open a new window with the source code. If you're using another major browser, Ctrl+U will show the source code.
HTML is a code language for markup. "Executing" would mean interpreting in this context, i.e. opening the file in a browser (displaying the page) rather than a text editor (displaying the code itself).
Using this code (<html>) look up a youtube tutorial
Any communication between Javascript code and PHP code needs to be instigated by the Javascript. This is because Javascript is a client side script and PHP is server side. The server can't force data to the browser; it can only reply to requests. The technique of using Javascript on the client side to talk to server side scripts is referred to as AJAX (Asynchronous Javascript And XML). There are several libraries available for simplifying it's usage, and many online tutorials.
As subtle distinction between HTML and browser is that HTML code does not produce the form; the browser produces the form. The browser interprets HTML code to determine how to display page content.
To "run" HTML code, you simply need to open it using a web browser. This can be done by placing the file on the server and pointing the browser to it, or you can use the native "Open File..." command in the browser itself. If you want to learn HTML you can visit one of the websites in the related links.
Some web browsers will allow code insertion and some will not. The ability to insert code depends on what browser you have and why you want to insert code into it.
Write an ASP code that will dislplay the source code of the web page in the Browser window.
what do you mean by the "source code" page viewed in a web browser
One can find examples of Ajax code on several tutorial websites. Among these are the extensive W3Schools website and a website which goes by the name of Noupe.