Fix bug of setValue and make demo.html runnable from the browser

Hi @tuanchauict 

The latest commit fixed the issues mentioned in your repository :D.