<html>
<head>
<script src="../../ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("input").select(function(){
$("input").after(" Text marked!");
});
$("#btn1").click(function(){
$("input").trigger("select");
});
$("#btn2").click(function(){
$("input").triggerHandler("select");
});
});
</script>
</head>
<body>
<p>Click each button to see the difference between trigger() and triggerHandler().
<p><input type="text" value="Hello World"></p>
<button id="btn1">trigger()</button>
<button id="btn2">triggerHandler()</button>
</body>
<!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_event_triggerhandler_trigger by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:33:16 GMT -->
</html>