What’s the difference between and , and ?

They have the same effect on normal web browser rendering engines, but there is a fundamental difference between them. As the author writes in a discussion list post: Think of three different situations: web browsers blind people mobile phones “Bold” is a style – when you say “bold a word”, people basically know that it … Read more

How do I properly escape quotes inside HTML attributes?

&quot; is the correct way, the third of your tests: <option value=”&quot;asd”>test</option> You can see this working below, or on jsFiddle. alert($(“option”)[0].value); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js”></script> <select> <option value=”&quot;asd”>Test</option> </select> Alternatively, you can delimit the attribute value with single quotes: <option value=””asd”>test</option>

What are all the valid self-closing elements in XHTML (as implemented by the major browsers)?

Every browser that supports XHTML (Firefox, Opera, Safari, IE9) supports self-closing syntax on every element. <div/>, <script/>, <br></br> all should work just fine. If they don’t, then you have HTML with inappropriately added XHTML DOCTYPE. DOCTYPE does not change how document is interpreted. Only MIME type does. W3C decision about ignoring DOCTYPE: The HTML WG … Read more

How do I link to part of a page? (hash?)

If there is any tag with an id (e.g., <div id=”foo”>), then you can simply append #foo to the URL. Otherwise, you can’t arbitrarily link to portions of a page. Here’s a complete example: <a href=”http://example.com/page.html#foo”>Jump to #foo on page.html</a> Linking content on the same page example: <a href=”#foo”>Jump to #foo on same page</a> It … Read more

Make a div into a link

Came here in the hope of finding a better solution that mine, but I don’t like any of the ones on offer here. I think some of you have misunderstood the question. The OP wants to make a div full of content behave like a link. One example of this would be facebook ads – … Read more