Free Puzzle Questions with Answer using Java, C#, JavaScript and PHP

JavaScript - Local Storage

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script language="JavaScript" type="text/javascript">
        function RememberCredentials(){
            localStorage.setItem("Username", document.getElementById('txtUsername').value);
            localStorage.setItem("Password", document.getElementById('txtPassword').value);
        }

        function LoadCredentials(){
            document.getElementById('txtUsername').value = localStorage.getItem("Username");
            document.getElementById('txtPassword').value = localStorage.getItem("Password");
        }

        function RemoveCredentials(){
            localStorage.removeItem("Username");
            localStorage.removeItem("Password");
            //localStorage.clear();
        }

    </script>
</head>
<body>
    <table style="width:500px; height: 200px">
        <tr>
            <td>Username</td>
            <td><input type="text" id="txtUsername" /></td>
        </tr>
        <tr>
            <td>Password</td>
            <td><input type="password" id="txtPassword" /></td>
        </tr>
        <tr>
            <td><button onclick="RememberCredentials()">Remember Credentials</button></td>
            <td><button onclick="RemoveCredentials()">Clear</button></td>
        </tr>
    </table>

    <script language="JavaScript" type="text/javascript">
        LoadCredentials();
    </script>
</body>
</html>