JS – Drop and display a file to a html

Javascript has a powerful event and DOM objects, that enable anyone to do fancy things with it. Today I have thought of writing a todo list in *.txt file and adding it to a *.htm file with javaScript. Something like this:

file1 file2file3

 

And it reads nicely every line of your todo.txt file and even takes the name of the file as a header. The other interesting trick is that the two div-s are changing colors, based on the events in the JavaScript like this:

If you know when to ask for adding css class and to remove it, the effect is really nice. Pretty much that is all. Here comes the code:

 

Available also in GitHub! Enjoy it! 🙂

Tagged with: , , ,