Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ** Demo code **
- var p = document.querySelector('p'),
- input = document.querySelector('input');
- function setText(v){
- p.innerHTML = formatBytes(v);
- }
- // bind 'input' event
- input.addEventListener('input', function(){
- setText( this.value )
- })
- // set initial text
- setText(input.value);
- <input type="text" value="1000">
- <p></p>
Add Comment
Please, Sign In to add comment