警报没有出现在我的React应用程序上并且代码出现在页面顶部

I'm new to react, and I've done a Form which I want to come up an alert when clicking the submit button. When I opened it on a browser through my local file it worked but when seeing on GitHub I don't get the same result, not sure why. I save it and push it to the repository. Here it's how it looks https://joanaoli09.github.io/milestone/

还有另一个问题。代码进入了HTML的头部(在检查时),这使其仅显示在页面的顶部,我不知道为什么或如何进行更改。

这是Form.js文件的代码:

import React from "react";
import "./Form.css";

export default class Form extends React.Component {
  state = {
    firstName: "",
    lastName: "",
    userName: "",
    email: "",
    password: ""
  };

 onSubmit = e => {
    alert("Your information has been uploaded");
    e.preventDefault();
    this.props.onSubmit(this.state);
    this.setState({
      firstName: "",
      lastName: "",
      userName: "",
      email: "",
      password: ""
    });
  };
  render() {
    return (
      <div className="formcontainer">
        <form className="Form">
          <p className="register">CREATE ACCOUNT</p>
          <input
            className="input"
            name="firstName"
            placeholder="First name"
            value={this.state.firstName}
            onChange={e => this.change(e)}
          />
          <br />
          <input
            className="input"
            name="lastName"
            placeholder="Last name"
            value={this.state.lastName}
            onChange={e => this.change(e)}
          />
          <br />
          <input
            className="input"
            name="username"
            placeholder="Username"
            value={this.state.username}
            onChange={e => this.change(e)}
          />
          <br />
          <input
            className="input"
            name="email"
            placeholder="Email"
            value={this.state.email}
            onChange={e => this.change(e)}
          />
          <br />
          <input
            className="input"
            name="password"
            type="password"
            placeholder="Password"
            value={this.state.password}
            onChange={e => this.change(e)}
          />
          <br />
          <button className="submit" onClick={e => this.onSubmit(e)}>
            Submit
          </button>
        </form>
      </div>
);
  }
}