Skip to content

Instantly share code, notes, and snippets.

@shenkev
Created May 24, 2017 18:08
Show Gist options
  • Save shenkev/dcf0acd49173dfcc15b659077bb5deb5 to your computer and use it in GitHub Desktop.
Save shenkev/dcf0acd49173dfcc15b659077bb5deb5 to your computer and use it in GitHub Desktop.
onHover response for each parameter
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<h1 align="center">F=ma</h1>
<script type="text/javascript">
$('h1').html(function(_, html) {
return '<span>' + html.split('').join('</span><span>') + '</span>';
});
$('span').hover(
function(e) {
alert("Hovered over " + $(e.target).text());
}, function() {}
)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment