0

I split my body content in two parts. The left one has a map and buttons. When I click on the button, I get the result from Arad.php in another window.

How can I set the target to the second half (split right) of my body?

<body> 
    <div class="split left">
        <div class="centered">    
            <h2>Button on Image</h2>
            <p>Add a button to an image:</p>
            <div class="container">
                <img src="Harta_Romaniei.jpg" alt="Harta_Romaniei" style="width:100%">
                <button class="btnarad"; onclick= "window.location.href='Arad.php'"; Target="split right">Arad</button>
                <button class="btntimisoara">Timisoara</button>
            </div>        
        </div>
    </div>
    <div class="split right">
      <div class="centered">
        <h2>Information</h2>

        // I want the information here!

        </div>
    </div>
</body>
Peyman Mohamadpour
  • 17,954
  • 24
  • 89
  • 100

1 Answers1

0

It doesn't have much to do with PHP, you should really do it with HTML + JavaScript.

The window.href.location will always redirect you to another route, and will never do what you want.

You'll need something like this: Simple Load an HTML page from javascript based on window width

Néstor
  • 416
  • 4
  • 10