the reason php can't do it is because php is server side, meaning php only lives on the remote server while the code is being compilated and executed. once the html output is generated and sent to the user, php is done and apache or whatever webserver in use takes over sending the html to the user. therefore, php has no control whatsoever over the user's browser and what it does. javascript, on the other hand, is client side, meaning the language is actually built into the users browser, so all the js code is run and controlled by their computer, so it is able to do a lot of things with the browser.