I recently created a simple HTML page with CSS and JavaScript. The code prompts the user to enter a password, which is then verified by the JavaScript code to display relevant information to the user through alerts. While this code works fine on my desktop, I encountered an issue when trying to run it on my Samsung Tablet - only the HTML content appeared. Below is the current code in use. It is all located in the same folder, but I am considering moving the main HTML file to the tablet's Home directory while keeping the CSS and JavaScript in a separate location for reference.
HTML
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="dowlingcss.css"/>
<title>
Dr. Dowling
</title>
</head>
<body>
<script src="dowlingjs.js"></script>
<img src="parasol.jpg" alt="Parasol Logo" height="250" width="750">
<h1>Welcome Dr. Dowling</h1>
<p>What is the answer?</P>
<form>
<input id="pass">
<button type="button" onclick="myfunction()">Login</button>
</form>
</body>
</html>
Javascript
function myfunction()
{
var x, text;
//Get the value of the input field with id="pass"
x = document.getElementById("pass").value;
var password = x.toLowerCase();
// If x is Not = to fatluke
if (password != "fatluke")
{
alert("incorrect");
}
else {
alert("The CD is in room 125 under the bed");
}
}