title: Can I use PHP in conjunction with Javascript?
body: <p>I know you can't use PHP inside of Javascript. Basically what I'm trying to do Is after clicking a link on one side of the web page, information that was stored in  a database will appear on the other side. So I know I can use javascript to make my lists on one side clickable but I also know that to get the data I want displayed from my database I need to use PHP to get it. Is there a way to make this work?</p>
  
  <p>EDIT:
  Heres some of my current code
  At what point could I implement PHP here after the user clicks on one of the lists?</p>
  
  <pre><code>&lt;script&gt;
    document.getElementById("demo").innerHTML = "My First JavaScript";
  
    function myFnc(x) {
      if (x == 'Tiger') {
        document.getElementById('imgDiv').innerHTML = 'Img1';
      } else if (x == 'Bull') {
        document.getElementById('imgDiv').innerHTML = 'Img3';
      }
    }
  
    function myFunc2(x) {
      if (x == 'Hammer') {
        document.getElementById('imgDiv').innerHTML = 'Img2';
      }
    }
  
  &lt;/script&gt;
  
  &lt;article&gt;
    &lt;ul style="list-style-type:none"&gt;
      &lt;li&gt;&lt;a href="#Tiger" onclick="myFnc('Tiger')"&gt;Tiger&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Hammerhead" onclick="myFunc2('Hammer')"&gt;Hammerhead&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Bull" onclick="myFnc('Bull')"&gt;Bull&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Great White"&gt;Great White&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Mako"&gt;Mako&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Greenland"&gt;Greenland&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Whale"&gt;Whale&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Thresher"&gt;Thresher&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Oceanic"&gt;Oceanic WhiteTip&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#Goblin"&gt;Goblin&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/article&gt;
  
  &lt;div class="hold"&gt;
    &lt;div id="imgDiv"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>