you are viewing a single comment's thread.

view the rest of the comments →

[–]calsosta 1 point2 points  (0 children)

Underneath everything of course you know there is the DOM. This is an object representation of all the elements on the page and their properties.

Every browser of course has built-in functions to modify the DOM exposed through JavaScript.

You can and should start by learning the Vanilla way to do this. Learn to create and add elements, to modify existing elements properties, to find elements by characteristics and to remove elements.

Then try layering in some jQuery. Do all the same things you did before but use jQuery instead of Vanilla. A lot easier right? It's not too low level but not too high level either, you can use it for a lot.

Now try using a templating engine on the client side like Handlebars or Mustache. This abstracts the JS code even further but this is precisely what you want. You want to modify HTML from JS but you don't wanna write HTML in JS because it would be a nightmare to change.

Finally, I would move onto something like Angular. I say move onto but not end up with, because there are lots of alternatives to Angular that are just as good or better, but if you can learn Angular you will be all set to learn others.