Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  <title>jQury Event Example</title>
</head>
<body>
   <!-- http://stackoverflow.com/questions/35398670/jquery-event-fired-multiple-times/35398761#35398761 -->
  
  <input type="text" value="Hello World">
  <br><br>
  <button>Trigger the select event for the input field</button>
</body>
</html>
 
// http://stackoverflow.com/questions/35398670/jquery-event-fired-multiple-times/35398761#35398761
$("input").on('select', function(event) {
  // Prevent event from being fired multiple times in Chrome
  event.preventDefault();
  
  $("input").after(" Text marked!");
});
$("button").on('click', function(){
  $("input").trigger('select');
});
Output

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

Dismiss x
public
Bin info
tedwpro
0viewers