Javascript – string starts with check
ECMAScript 6 String.prototype.startsWith() method can be used to check if a string starts with something. But it is not yet supported by all browsers. Another read more
Python if-else and if-elif-else
Python if else statements can be expressed on two ways Simple if-else statement if-elif-else statement with one or more occurrences of elif. if else example read more
jQuery – get class list of DOM element
jQuery code snippet to get class list of an element. We are using jQuery attr(“class”) to get the class list as string and then splitting read more
jQuery – create iframe with content
Sometimes we need to create inline iframe with content generate from jQuery/Javascript. This iframe will not have src attribute. One use case is to run read more
CSS attribute substring selectors
CSS attribute selector can be used to select DOM elements based on matching substring of attribute values. We can use attribute substring selectors in multiple read more
CSS type selectors – define style by element name
The CSS type selector matches element by node name (e.g. div, h1. h2). This can be used to specify CSS style based on element type. read more
CSS pseudo class :visited – style for visited links
CSS :visited pseudo-class applies once the link has been visited by the user Example – use :visited to apply style to visited links This example read more
CSS pseudo class :link – style for unvisited links
CSS :link pseudo-class applies to links that have not yet been visited. Example – use :link to apply style to unvisited links This example displays read more
CSS pseudo class :focus
The :focus pseudo-class applies while an element has the focus. There can be various ways to get focus on an element. Some of these are: read more
CSS pseudo class :active
The :active pseudo-class applies while an element is being activated (e.g. clicked) by the user. For example, between the times the user presses the mouse read more