OneCompiler

Trouble with HTML

I'm a student coder, and my group is working on building an Angular web app that is a library of code, and we are trying to use your embedded compiler, however the resource fails to load only when using HTML which is one of the most important languages for our project. Is anyone else having this issue?

5 Answers

2 years ago by

def fibonacci_till_num(last_num):
a, b = 0, 1
while a <= last_num:
print(a, end=' ')
a, b = b, a+b
number = int(input('please enter one natural number: '))
fibonacci_till_num(number)

2 years ago by Syed Thousif

It's because you're online, never works for me either, so if you are making mutiple html files just use your own computer and make html files, but if not use the

 <script> and <style>
2 years ago by edwardo is alpha

no

10 months ago by Yash Nandanwar

im in grade 6 and i need to make an html document for my school project,i typed a small code nd its literally taking so long to run! anyone else who thinks this thingy needs to be fixed??

6 months ago by Tapeshwar Hazari
<!DOCTYPE html> <html> <head> <title>Hospital Management System</title>
<style>
    body {
        font-family: Arial;
        margin: 0;
        padding: 0;
        background: linear-gradient(to right, #4facfe, #00f2fe);
    }

    .container {
        width: 100%;
        height: 100vh;
    }

    /* LOGIN PAGE */
    #loginPage {
        text-align: center;
        padding-top: 120px;
    }

    .login-box {
        background: white;
        padding: 20px;
        width: 300px;
        margin: auto;
        border-radius: 10px;
    }

    input, select {
        width: 90%;
        padding: 10px;
        margin: 10px;
    }

    button {
        padding: 10px 20px;
        background: blue;
        color: white;
        border: none;
        cursor: pointer;
    }

    #error {
        color: red;
    }

    /* HOME PAGE */
    #homePage {
        display: none;
        padding: 20px;
        background: #f0f8ff;
        min-height: 100vh;
    }

    h1 {
        text-align: center;
        background: #007bff;
        color: white;
        padding: 10px;
        border-radius: 5px;
    }

    .form-box {
        background: white;
        padding: 20px;
        border-radius: 10px;
        width: 400px;
        margin: auto;
        box-shadow: 0 0 10px gray;
    }

    table {
        width: 100%;
        margin-top: 20px;
        border-collapse: collapse;
        background: white;
    }

    table, th, td {
        border: 1px solid black;
    }

    th {
        background: #007bff;
        color: white;
    }

    td {
        text-align: center;
        padding: 10px;
    }

    .logout {
        float: right;
        background: red;
    }
</style>
</head> <body> <div class="container">
<!-- LOGIN PAGE -->
<div id="loginPage">
    <div class="login-box">
        <h2>Hospital Login</h2>

        <input type="text" id="username" placeholder="Username"><br>
        <input type="password" id="password" placeholder="Password"><br>

        <button onclick="login()">Login</button>

        <p id="error"></p>
    </div>
</div>

<!-- HOME PAGE -->
<div id="homePage">

    <button class="logout" onclick="logout()">Logout</button>

    <h1>Hospital Management System</h1>

    <div class="form-box">

        <h3>Add Patient</h3>

        <input type="text" id="name" placeholder="Patient Name">
        <input type="number" id="age" placeholder="Age">
        <input type="text" id="disease" placeholder="Disease">

        <select id="doctor">
            <option value="">Select Doctor</option>
            <option>Dr. Ravi</option>
            <option>Dr. Meena</option>
            <option>Dr. Kumar</option>
        </select>

        <button onclick="addPatient()">Add Patient</button>

    </div>

    <table id="patientTable">
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Age</th>
            <th>Disease</th>
            <th>Doctor</th>
        </tr>
    </table>

</div>
</div> <script> let id = 1; /* LOGIN FUNCTION */ function login() { let user = document.getElementById("username").value; let pass = document.getElementById("password").value; if(user === "admin" && pass === "1234") { document.getElementById("loginPage").style.display = "none"; document.getElementById("homePage").style.display = "block"; } else { document.getElementById("error").innerText = "Invalid Login!"; } } /* LOGOUT */ function logout() { document.getElementById("loginPage").style.display = "block"; document.getElementById("homePage").style.display = "none"; } /* ADD PATIENT */ function addPatient() { let name = document.getElementById("name").value; let age = document.getElementById("age").value; let disease = document.getElementById("disease").value; let doctor = document.getElementById("doctor").value; if(name === "" || age === "" || disease === "" || doctor === "") { alert("Please fill all fields!"); return; } let table = document.getElementById("patientTable"); let row = table.insertRow(); row.insertCell(0).innerText = id++; row.insertCell(1).innerText = name; row.insertCell(2).innerText = age; row.insertCell(3).innerText = disease; row.insertCell(4).innerText = doctor; // Clear fields document.getElementById("name").value = ""; document.getElementById("age").value = ""; document.getElementById("disease").value = ""; document.getElementById("doctor").value = ""; } </script> </body> </html>
1 month ago by Jeevan G.T