addEventListner() in js

<script> window.addEventListener('load', function () { document.getElementById("btn").click(); }) </script> document.addEventListener("click", function(){   document.getElementById("demo").innerHTML = "Hello World"; }); document.addEventListener("mouseover", triggerBtnClick); document.addEventListener("click", someOtherFunction); document.addEventListener("mouseout", someOtherFunction); <script> function triggerBtnClick() { document.getElementById("btn").click(); } </script

0 Comments

setTimeout() in javascript and trigger click event

const myTimeout = setTimeout(myGreeting, 5000); function myGreeting() { alert('hi'); } <input type='button' name='osx' value='Demo' class='osx demo' runat="server" /> <script> $("document").ready(function () { window.getElementById("osx").click(); }); </script> <script> window.addEventListener('load', function () {…

0 Comments

Javascript foreach()

<p id="demo"></p> <script> const numbers = [65, 44, 12, 4]; numbers.forEach(myFunction) document.getElementById("demo").innerHTML = numbers; function myFunction(item, index, arr) { arr[index] = item * 10; } </script> </body>

0 Comments

tab

<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Control buttons --> <div id="myBtnContainer"> <button class="btn active" onclick="filterSelection('all')">…

0 Comments

Filter table

<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for names.."> <table id="myTable"> <tr…

0 Comments