List append() in for loop

The list.append function does not return any value(but None), it just adds the value to the list you are using to call that method. In the first loop round you will assign None (because the no-return of append) to a, then in the second round it will try to call a.append, as a is None … Read more

The preferred way of creating a new element with jQuery

The first option gives you more flexibilty: And of course .html(‘*’) overrides the content while .append(‘*’) doesn’t, but I guess, this wasn’t your question. Another good practice is prefixing your jQuery variables with $:Is there any specific reason behind using $ with variable in jQuery Placing quotes around the “class” property name will make it more compatible with less flexible browsers.