All Questions

1896
votes
25answers
780063 views

Storing Objects in HTML5 localStorage

I'd like to store a JavaScript object in HTML5 localStorage, but my object is apparently being converted to a string. I can store and retrieve primitive JavaScript types and arrays using localStorage...
240
votes
5answers
142539 views

jQuery Mobile: document ready vs. page events

I am using jQuery Mobile, and I am having trouble understanding differences between classic document ready and jQuery Mobile page events. What is the real difference? Why should <!-- language: ...
528
votes
6answers
229116 views

Are (non-void) self-closing tags valid in HTML5?

The W3C validator doesn't like self-closing tags (those that end with "/>") on non-void elements. (Void elements are those that may not ever contain any content.) Are they still valid in HTML5? So...
3430
votes
30answers
1558290 views

Change an HTML5 input's placeholder color with CSS

Chrome supports the placeholder attribute on input[type=text] elements (others probably do too). But the following CSS doesn't do diddly squat to the placeholder's value: input[placeholder], [pl...
259
votes
7answers
384674 views

Flexbox: center horizontally and vertically

How to center div horizontally, and vertically within the container using flexbox. In below example, I want each number below each other (in rows), which are centered horizontally. .flex-containe...
745
votes
2answers
339949 views

Using HTML5/Canvas/JavaScript to take in-browser screenshots

Google's "Report a Bug" or "Feedback Tool" lets you select an area of your browser window to create a screenshot that is submitted with your feedback about a bug. Screenshot by Jason Small, posted i...
443
votes
2answers
175581 views

jQuery Data vs Attr?

What is the difference in usage between $.data and $.attr when using data-someAttribute? My understanding is that $.data is stored within jQuery's $.cache, not the DOM. Therefore, if I want to use $....
579
votes
55answers
1279491 views

HTML text input allows only numeric input

Is there a quick way to set an HTML text input (<input type=text />) to only allow numeric keystrokes (plus '.')?
358
votes
10answers
534284 views

How to send FormData objects with Ajax-requests in jQuery?

The XMLHttpRequest Level 2 standard (still a working draft) defines the FormData interface. This interface enables appending File objects to XHR-requests (Ajax-requests). Btw, this is a new feature -...
502
votes
13answers
586940 views

Is there any way to change input type="date" format?

I'm working with HTML5 elements on my webpage. By default input type="date" shows date as YYYY-MM-DD. The question is, is it possible to change it's format to something like: DD-MM-YYYY?

Previous Next