Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  
  <p>Hello <span>world</span></p>
  <button id="b1">Click me</button>
  <script type="text/javascript" src="s1_script_externe.js">
    <!-- en fait, jbin injecte tout seul le code tout seul JS ci-contre, mais dans un exemple réel, il y faire référence via une balise <script> -->
  </script>
</body>
</html>
 
// jshint eqeqeq:true, undef:true, devel:true, browser:true
function f1() {
  console.log('haha, tickles');
}
function f2() {
  console.log('click');
}
function cree_abonnements() {
  document.getElementsByTagName('span')[0]
    .addEventListener('mouseover', f1);
  document.getElementById('b1')
    .addEventListener('click', f2);
}
window.addEventListener("load", cree_abonnements);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
pchampinpro
0viewers