Skip to content

Instantly share code, notes, and snippets.

@tomhodgins
Created February 12, 2020 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomhodgins/649b7e204a86a86395b1d8ed90bfb767 to your computer and use it in GitHub Desktop.
Save tomhodgins/649b7e204a86a86395b1d8ed90bfb767 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<body>
<input>
<script type=module>
import jsincss from 'https://unpkg.com/jsincss/index.vanilla.js'
import expand from 'https://unpkg.com/jsincss-auto-expand/index.vanilla.js'
jsincss(event => expand('input', 'width'))
// Simulate late addition to DOM
setTimeout(
() => document.body.innerHTML += `<input placeholder="dynamically added later…">`,
5000 // 5 seconds
)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment