Skip to main content


Showing posts with the label Javascript

How To add JavaScript Progress Bar in website

<!DOCTYPE html>
#myProgress {
  position: relative;
  width: 100%;
  height: 30px;
  background-color: #ddd;

#myBar {
  position: absolute;
  width: 10%;
  height: 100%;
  background-color: #4CAF50;

#label {
  text-align: center;
  line-height: 30px;
  color: white;

<h1>JavaScript Progress Bar</h1>

<div id="myProgress">
  <div id="myBar">
    <div id="label">10%</div>

<button onclick="move()">Click Me</button>

function move() {
  var elem = document.getElementById("myBar");
  var width = 10;
  var id = setInterval(frame, 10);
  function frame() {
    if (width >= 100) {
    } else {
      width++; = width + '%';
      document.getElementById("label").innerHTML = width * 1  + '%';

HTML Javascript Password Tips

Javascript: Password Tips If you want a page to be password protected, look at these html tips and tricks.

The first step is to find a web page that is password protected.
Mine is:

The second step is to find a web page that will be gone to if the visitor types in the wrong password.
I chose:
It may be better, however, to make a page that will say, for example, "YOUR PASSWORD IS INCORRECT. CLICK HERE TO TRY AGAIN. CLICK HERE TO GO BACK."

The third step is to insert the following code in between <head> and </head> on your password protected page:
<SCRIPT language="JavaScript">
var password;
var pass1="cool";
password=prompt('Please enter your password to view this page!',' ');
if (password==pass1)
alert('Password Correct! Click OK to enter!');