HTML file is not running anything

I created PHP Empty Project. PHP file is running. but I need to use html file to get data.

The main issue here is that html file is not even getting external css file. Neither javascript nor PHP within it is working.

I need to add these files externally but I have tried internally and still no response.

Another thing I noticed that it want Node.js for simple javascript file.

I am new to Web Development too. Currently a Student.

2 comments
Comment actions Permalink

You have a typo in html (PhpStorm even highlighted it):

0
Comment actions Permalink

Plus, in your code you have

document.getElementById("demo")

but there are no elements with such Id in your code. Try changing it to

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="ftext.css">
<script type="text/javascript">
function changeText() {
document.getElementById("demo").innerHTML = "Hello World!";
}
</script>
</head>
<body>
<div id="1">
<p id="demo">This will be replaced by JavaScript</p>
<button type="button" onclick="changeText()">Change Text</button>
</div>
</body>
</html>

 

>Another thing I noticed that it want Node.js for simple javascript file.

 

Yes, it's expected - PhpStorm can't itself execute JavaScript, Node.js interpreter is required for running server-side code. Please see https://www.jetbrains.com/help/phpstorm/2019.1/running-and-debugging-node-js.html, https://www.jetbrains.com/help/phpstorm/2019.1/developing-node-js-applications.html#ws_node_configure_local_node_interpreter for instructions

0

Please sign in to leave a comment.