Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Content</title>
- </head>
- <body>
- <div>
- <div id="atom1" contenteditable="true">
- atom
- </div>
- </div>
- <script>
- var atom = document.getElementById("atom1")
- atom.addEventListener('focus', function(event) {
- console.log('focus' + event.target.id)
- })
- atom.addEventListener('blur', function(event) {
- console.log('blur' + event.target.id)
- })
- atom.addEventListener('input', function(event) {
- //outputs in all browsers except IE11
- console.log('input' + event.target.id)
- })
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement