How to Use PHP, Javascript (or jQuery), and HTML Together


  1. Dave says

    Thank you very much! You made it clear what each language can do. I was missing something, but it just clicked!

    • Reema Srivastava says

      what is work of ajax?
      i know that ajax works nothing to load whole web page its work on particular element to which execute. but i have some confusion in ajax. please tell me about ajax.

      • cindy cullen says

        Ajax goes out to the server behind the scenes and doesn’t refresh the page. You can use javascript to fill values in elements without refreshing the page.

        <div id=”mydiv”></div>

        <script>$.ajax(‘’).done(function(data) { $(‘#mydiv’).html(data); });</script>

  2. Jihed says

    I’m starting a webapp project i had no idea where to start or which language i should use, you made it clear, thank you so much!

  3. Aarushi says

    This has really helped! Just one very basic doubt, as I am a beginner, what extension should i use to save my code?

    • Cindy says

      Always use .php because the server has to parse your file and replace all the php code before it sends the file to the user/client computer.

  4. Nirmal says

    Great article. Thank you for remembering that us beginners can find the whole web development architecture pretty daunting

  5. Gouri says

    my browser is not working for html css and java script combined in one notepad file. what extension should i use to make it work and what should i include in the code to make this happen.

  6. Timmy says

    Very helpful. I have written a html code, CSS and php codes separetely and saved in www folder for my Apache. Well, so when I load the html file, its well decorated by the css file and it looks beautiful. I have forms where i collect user details . I am wondering if its possible to “decorate the server side. I have tried linking the php code that displays captured info from html with a css file to decorate output but it doent happen.

    Also i have tried to use a javascript function to show a pop up but it doesnt work. Any help?

  7. Ashly says

    I need to make a web page that shows a form, in which a text-input shows the current year information first while user can enter a different year. A SUBMIT button is clicked to check if the year in the text-input is a leap year or not.

    How can i do this using both php and javascript simultaneously?

  8. Aarushi says

    Thank you Cindy.
    Can you explain about how can we test our application once we build one?
    For example, html, css and javascript can be tested on the browser, but for php we need to set up a server and database.


  1. […] the PHP code. The PHP code should create valid HTML, CSS or Javascript code. See my other post, How to Use PHP, Javascript (or jQuery), and HTML Together for more information about how all the languages work […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.