<?php
session_start();
echo "<script language='javascript'>
document.addEventListener('DOMContentLoaded',
function(){
console.log('11');
console.log(document.getElementById('#login_links_login'));
})
</script>";
?>
<!DOCTYPE html>
<html>
<body>
<!-- form goes here -->
</body>
</html>
This is my php code. It is at the top of my page. After this i have html form.
I want to open my html form from php. I know that i can do it from JQuery/Javascript or keep it open. I want it from php for my another purpose.
But console returns
11
null
But i included those two lines inside DomContentLoaded method of javascript. But it doesn't work.
My browsers are mozilla, webkit.
How do i achieve this?
Aucun commentaire:
Enregistrer un commentaire