codingtcher.com
Theme Night
Home
Login

Html

Home » Html

html

<!DOCTYPE html>
<html>
<body>
  <p id="demo"></p>
//JavaScript can create dynamic HTML content:
<script>
document.getElementById("demo").innerHTML = "Date : " + Date(); </script>
</body>
</html>

html

 <input type="text">  
    <input type="password">  
    <input type="radio">  
    <input type="checkbox">  
    <input type="hidden">  
    <input type="time">  
    <input type="submit">   
    <input type="reset">  
    <input type="tel">  
    <input type="search">   
    <input type="week">
    <input type="range">   
    <input type="month">   
    <input type="url">  
    <input type="button" value="click">   
    <input type="email" value="[email protected]">   
    <input type="date" value="08/05/1996">  
    <input type="number" value="199999">  
    <input type="image" placeholder="image"  style="width:30px  " >   
    

html example

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  	<link rel="icon" href="past here your logo path" type="image/x-icon">
  
    <title>Website title</title>
</head>
<body>
    <!-- Body -->
</body>
</html>

html

/*when you Click on these buttons it should call the function changeColor
and the function will change the color  */

    <button onclick="changeColor(this, 'red')">
      Click me to change my color.
    </button>

    <button onclick="changeColor(this, 'blue')">
        Click me to change my color.
      </button>

      <button onclick="changeColor(this, 'green')">
        Click me to change my color.
      </button>

    <script>
      function changeColor(element, color) {
        element.style.color = color;
    }
    </script>



html

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript addEventListener()</h2>

<p>This example uses the addEventListener() method to add many events on the same button.</p>

<button id="myBtn">Try it</button>

<p id="demo"></p>

<script>
var x = document.getElementById("myBtn");
x.addEventListener("mouseover", myFunction);
x.addEventListener("click", mySecondFunction);
x.addEventListener("mouseout", myThirdFunction);

function myFunction() {
  document.getElementById("demo").innerHTML += "Moused over!<br>";
}

function mySecondFunction() {
  document.getElementById("demo").innerHTML += "Clicked!<br>";
}

function myThirdFunction() {
  document.getElementById("demo").innerHTML += "Moused out!<br>";
}
</script>

</body>
</html>

Html Related Post