All In One Script
MENU

How do I reformat HTML code using Sublime Text 2?

by 5:10:00 AM
undefined
How do I reformat HTML code using Sublime Text 2? I've got some poorly-formatted HTML code that I'd like to reformat. Is there a command that will automatically reformat HTML code in Sublime Text 2 so it looks better and is easier to read? Answer: You don't need any plugins to do this. Just select all lines (CtrlA) and then from the menu select Edit → Line → Reindent. This will work if your file is saved with an extension that contains HTML

Redirect from an HTML page?

by 5:08:00 AM
undefined
Redirect from an HTML page? Is it possible to set up a basic HTML page to redirect to another page on load? Solution: Try using: <meta http-equiv="refresh" content="0; url=http://example.com/" /> Note: Place it in the head section. Additionally for older browsers if you add a quick link in case it doesn't refresh correctly: <p><a href="http://example.com/">Redirect</a></p> Will appear as Redirect This will still allow you to get to where your going with an additional click. http://stackoverflow.com/questions/5411538/redirect-from-an-html-page

by 5:06:00 AM
undefined
<button> vs. <input type=“button” />. Which to use? When looking at most sites (including SO), most of them use: <input type="button" /> instead of: <button></button> What are the main differences between the two, if any? Are there valid reasons to use one instead of the other? Are there valid reasons to use combine them? Does using <button> come with compatibility issues, seeing it is not very widely used? answer: Here's a page describing the differences (basically you can put html into a <button></button>) And an other page describing

Creating a div element in jQuery

by 5:39:00 AM
undefined
Creating a div element in jQuery How do I create a div element in jQuery? solution: First select the parent element with something like $("#id"), $("element") or $(".class") Then use the .append("<div>foo</div>") function. Alternatively, you can use the .html() as mentioned in a different answer. $("#foo").append("<div>hello world</div>") http://stackoverflow.com/questions/867916/creating-a-div-element-in-jquery

How to move an element into another element?

by 5:35:00 AM
undefined
How to move an element into another element? I would like to move one DIV element inside another. For example, I want to move this (including all children): <div id="source"> ... </div> into this: <div id="destination"> ... </div> so that I have this: <div id="destination"> <div id="source"> ... </div> </div> Answer: You may want to use the appendTo function (which adds to the end of the element): $("#source").appendTo("#destination"); Alternatively you could use the prependTo function (which adds to the beginning of the element): $("#source").prependTo("#destination"); http://stackoverflow.com/questions/1279957/how-to-move-an-element-into-another-element

RegEx match open tags except XHTML self-contained tags

by 3:22:00 AM
undefined
RegEx match open tags except XHTML self-contained tags I need to match all of these opening tags: <p> <a href="foo"> But not these: <br /> <hr class="foo" /> I came up with this and wanted to make sure I've got it right. I am only capturing the a-z. <([a-z]+) *[^/]*?> I believe it says: Find a less-than, then Find (and capture) a-z one or more times, then Find zero or more spaces, then Find any character zero or more times, greedy, except /, then Find

HTML 5: Is it
,
, or
?

by 3:20:00 AM
undefined
HTML 5: Is it <br>, <br/>, or <br />? I've tried checking other answers, but I'm still confused--especially after seeing W3schools HTML 5 reference. I thought HTML 4.01 was supposed to "allow" single-tags to just be <img> and <br>. Then XHTML came along with <img /> and <br /> (where someone said that the space is there for older browsers). Now I'm wondering how I'm supposed to format my code when practicing HTML 5. <!DOCTYPE HTML> Is it <br>, <br/> or <br />? Answer: Simply <br> is sufficient. The other forms are there for compatibility with XHTML; to

Instagram