Skip to main content

Posts

Showing posts from May, 2012

css link remove dotted outline

Its quite awkward to look at the link, when it is clicked and the dotted outline appears on it. To overcome it, just add the following line to your css file: a { outline: 0; } For example, to remove the dotted outline for the menu links on your page, add this to your css: #navigation li a {    outline: 0; } ( Assuming you have this menu structure: <ul id="navigation"><li><a href="news.html">News</a></li></ul> )

Javascript get array key from value

This is an example function that can search for a key in a javascript array and return it... function check(v) {     var x = new Array();     x = { a: '1', b: '2', c: '3' };         for(var key in x)     {         if(x[key] == v)         console.log(key);     } } Test: check(2);   // b