Horje
if button is pressed js Code Example
if button is pressed js
<button>A</button>
<button>B</button>
<button>C</button>
<script>
  document.body.addEventListener("click", event => {
    if (event.target.nodeName == "BUTTON") {
      console.log("Clicked", event.target.textContent);
    }
  });
</script>




Javascript

Related
add variable numerically in javascript Code Example add variable numerically in javascript Code Example
js random int Code Example js random int Code Example
jquery remove element Code Example jquery remove element Code Example
generate random int js Code Example generate random int js Code Example
npm ERR! command  /d /s /c node-pre-gyp install --fallback-to-build Code Example npm ERR! command /d /s /c node-pre-gyp install --fallback-to-build Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7