Just a collection of interesting questions on StackOverflow, the programmer’s greatest online Q&A source.
JavaScript
- How to detect caps lock?
- How to validate numbers?
- How to copy to the clipboard?
- How to validate emails?
- How to pretty-print JSON?
- How to check if a checkbox is checked?
- You cannot comment JSON files
- The difference between
==
and===
- How to check if one string contains another string?
- How to check if a DOM element exists?
- How to test if a DOM element is visible?
- How to tell apart left/right click?
- How to hide a
div
when you click outside of it? - A practical explanation of JavaScript closures
- How to get the current URL of the page
document.createElement
… in jQuery- How to empty an array
- What does
!!
mean? - How to detect if JavaScript is disabled
- Calling JavaScript code in an
iframe
- How to get dimensions of web page, screen, and browser?
- Playing sound in JavaScript
- How to test whether the browser window is currently visible?
- How to add minutes to time?
- How to add hours to time?
- Textarea
maxlength
attribute emulation
HTML/CSS
- Keep parents of floating elements from collapsing
- Center a div in a div
<b>
vs.<strong>
,<i>
vs.<em>
- Changing input placeholder text color with CSS
- Clarifying relative URLs in CSS
- Fill the remaining page height with a
div
- Style a dropdown with just CSS
- Should I use
button
orinput type="button"
? - Disable text selection highlighting
- How to set cellpadding and cellspacing?
- What clearfix should I use?
- Applying CSS to an
iframe
- Align content to bottom of a
div
- Simulating
float: bottom
- You cannot write
:hover
inline - Dynamically changing website favicon
- Style: why do we use dashes for ids and classes?
PHP
- What does ___ mean in PHP?
- How to prevent SQL injection
- Get the first element of an array
require_once
vs.include
- Performance of
===
vs.==