If I'm using an &lt;a&gt; tag click event to trigger an ajax call, and I don't want the link to physically go anywhere, what is the correct value for the href attribute?   Is it '#' or just leave it empty?  (I understand the accessibility issues that this brings).
27396
The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?    function myJsFunc() {     alert("myJsFunc"); } &lt;a href="#" onclick="myJsFunc();"&gt;Run JavaScript Code&lt;/a&gt;     or    function myJsFunc() {     alert("myJsFunc"); }  &lt;a href="javascript:void(0)" onclick="myJsFunc();"&gt;Run JavaScript Code&lt;/a&gt;
36235
I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.  I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is?  EDIT: The attribute filters allow you to select based on patterns of an attribute value.
26203
I'm trying to direct a browser to a different page. If I wanted a GET request, I might say  document.location.href = 'http://example.com/q=a';   But the resource I'm trying to access won't respond properly unless I use a POST request. If this were not dynamically generated, I might use the HTML  &lt;form action="http://example.com/" method="POST"&gt;   &lt;input type="hidden" name="q" value="a"&gt; &lt;/form&gt;   Then I would just submit the form from the DOM.  But really I would like JavaScript code that allows me to say  post_to_url('http://example.com/', {'q':'a'});   What's the best cross browser implementation?  Edit   I'm sorry I was not clear. I need a solution that changes the location of the browser, just like submitting a form. If this is possible with , it is not obvious. And this should not be asynchronous, nor use XML, so Ajax is not the answer.
54161
The  says:  Hyperlinks can be formatted as [basic links](http://example.com)  Then I write [This is a link description](http://linkurl.com) and the result is unexpected.  (You can see my comment .)  What am I doing wrong?  If the comment help is ambiguous, how do I notify StackOverflow to turn it better?
59713
Given that there is no logically default animal from the list of animals below, what should be the "Default Value" below, according to best practice?  &lt;label for="animal"&gt;Animal (required):&lt;/label&gt; &lt;select name="animal"&gt;   &lt;option value=""&gt;Default Value&lt;/option&gt;   &lt;option value="0"&gt;Cat&lt;/option&gt;   &lt;option value="1"&gt;Dog&lt;/option&gt;   &lt;option value="2"&gt;Horse&lt;/option&gt;   &lt;option value="3"&gt;Pig&lt;/option&gt;   &lt;option value="4"&gt;Sheep&lt;/option&gt; &lt;/select&gt;   A blank value, &lt;option value=""&gt;&lt;/option&gt;?  Something visually irritating, &lt;option value=""&gt;***CHOOSE ANIMAL***&lt;/option&gt;?  Something which blends in but provides instruction, &lt;option value=""&gt;Select an Animal&lt;/option&gt;?  Something else entirely?
21739
I want to turn off the feature where whenever I hover over a hyperlink and in the bottom lefthand corner it shows a light blue hover tooltip about where that link goes.   Why do I want to turn it off? It's annoying to me. I am distracted as I work. None of the other browsers do it. Besides, it serves little purpose because it can be spoofed with the onmousedown event on a link. Take for instance ads on Facebook -- those spoof.   I really don't care where a given link goes and wish I could turn that feature off, even if I have to install a Google Chrome Extension.   So, is there a fix to turn the annoying link hover tooltip feature off?
9968
I've been making a concerted effort to improve my javascript skills lately by reading as much javascript code as I can. In doing this I've sometimes seen the javascript: prefix appended to the front of event handler attributes in HTML element tags. What's the purpose of this prefix? Basically, is there any appreciable difference between:  onchange="javascript: myFunction(this)"   and  onchange="myFunction(this)"   ?
5081
What are the rules of engagement with respect to SEO in HTML 5?  Examples of things we have been mulling over with no conclusion:   Are you penalised for not using &lt;head&gt; and &lt;body&gt; tags? Do links in &lt;nav&gt; blocks get prioritised for follows? With &lt;aside&gt; (no bside though), &lt;section&gt;, &lt;summary&gt; and &lt;details&gt; which ones carry the most weight for content, one-liner descriptions and keyword tags are there search engine implications? If you use CSS to put a &lt;footer&gt; element at the top and a &lt;header&gt; element at the bottom (not that you would but it may be construed as such by an incomplete spider implementation)? Does the use of placeholder attributes on &lt;input&gt; show you are more user focused?   At the minute we are haphazardly pinning the content on the donkey with regard to tag usage but would be interesting to know if anyone has any insight into the "correct" tags to use with regards to SEO.
10610
I have a url like   I need a javascript function to give me the 'th' value from that.  All my urls have the same format (2 letter filenames, with .html extension).  I want it to be a safe function, so if someone passes in an empty url it doesn't break.  I know how to check for length, but I should be checking for null to right?
23137
I was browsing the html of my favorite site...ahem...and I saw this in the markup:  &lt;link href="/Content/all.min.css?d=20090107" rel="stylesheet" type="text/css" /&gt;   what does "?d=20090107" do? I'm assuming it's a date of some kind, but I'm not sure why it's in the path to the file. Any ideas?
119762
I'm trying to answer a question, and for that I need to mark 4 different mock (fake) urls and what they'd have. When I type this, a link is automatically created, and I would like to avoid this behaviour since this page doesn't exist. I want to create a link only if I do [] () without space in the middle. Is this even possible? Example of what I mean:    Code for that page   That shouldn't have a link automatically created since it doesn't exist, but inserting it in code is not feasible (because next line is code for that page and there should be a separation). Block quotes didn't work either. I'm asking if this is possible without breaking the url itself, only the hyperlink.
32205
Consider the following:  &lt;div onclick="alert('you clicked the header')" class="header"&gt;   &lt;span onclick="alert('you clicked inside the header');"&gt;something inside the header&lt;/span&gt; &lt;/div&gt;   How can I make it so that when the user clicks the span, it does not fire the div's click event?
9665
Recently the  (106) tag was created. It should be merged with  (385) tag. The  tag is more general and it is the older one, but should it be the one to live on? This seems disputable as I haven't heard of a virtual function which is not a method.
33995
I am confused about hreflang="x-default".  I have a site in 2 languages. In each page I have a link to the page itself and a link to the same page in the other language. If I understand correctly, I have to put an x-default also. In my case it goes to the page "language". There the user can see two buttons to choose the language of the site.  The x-default link is the same on all pages and it is present in all of them.   &lt;link rel="alternate" hreflang="en" href="http://example.com/about" /&gt;  &lt;link rel="alternate" hreflang="fr" href="http://example.com/fr/about" /&gt; &lt;link rel="alternate" hreflang="x-default" href="http://example.com/language" /&gt;   I use Screaming Frog to detect possible errors. It says "Missing confirmation links in all the pages" when I see the details of the error. It makes reference only to the x-default link. I do not understand.  How to use the hreflang="x-default"?
107111
Upon page load I want to move the cursor to a particular field.  No problem.  But I also need to select and highlight the default value that is placed in that text field.
25094
I have HTML code like this :  &lt;div&gt;        &lt;a&gt;Link A1&lt;/a&gt;        &lt;a&gt;Link A2&lt;/a&gt;        &lt;a&gt;Link A3&lt;/a&gt; &lt;/div&gt;  &lt;div&gt;        &lt;a&gt;Link B1&lt;/a&gt;        &lt;a&gt;Link B2&lt;/a&gt;        &lt;a&gt;Link B3&lt;/a&gt; &lt;/div&gt;   When user clicks a link from above HTML, I want to get the jQuery object of the corresponding &lt;a&gt; element, and then manipulate its sibling. I can't think of any way other than creating an ID for each &lt;a&gt; element, and passing that ID to an onclick event handler. I really don't want to use IDs.   Any suggestions?
75718
I'm dynamically adding &lt;script&gt; tags to a page's &lt;head&gt;, and I'd like to be able to tell whether the loading failed in some way -- a 404, a script error in the loaded script, whatever.  In Firefox, this works:  var script_tag = document.createElement('script'); script_tag.setAttribute('type', 'text/javascript'); script_tag.setAttribute('src', 'http://fail.org/nonexistant.js'); script_tag.onerror = function() { alert("Loading failed!"); } document.getElementsByTagName('head')[0].appendChild(script_tag);   However, this doesn't work in IE or Safari.  Does anyone know of a way to make this work in browsers other than Firefox?  (I don't think a solution that requires placing special code within the .js files is a good one. It's inelegant and inflexible.)