Skip to content

Instantly share code, notes, and snippets.

@Octagon-simon
Created October 25, 2021 18:13
Show Gist options
  • Select an option

  • Save Octagon-simon/87212a002b55cf66dfbe6f98d5fece9c to your computer and use it in GitHub Desktop.

Select an option

Save Octagon-simon/87212a002b55cf66dfbe6f98d5fece9c to your computer and use it in GitHub Desktop.
<script>
function myfunc(x = "this") {
var dataValue = x.value;
console.log(dataValue);
}
document.addEventListener('DOMContentLoaded', (event) => {
//Add an Input Event
document.querySelector('#inp_foo').addEventListener('input', function() {
myfunc(this);
});
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment