How can I change the color of an onClick of the link 'a href '?

I just wanted to ask, how would I go about changing the color of the < a href > link on click using javascript for the id is highlighted in bold, maybe "addClass" syntax would do the trick?

I also want the original link to return to its original color when or the other highlighted links are clicked. In other words, a single link shows color is selected at a time.

< head >

" < link href =" https://fonts.googleapis.com/CSS?family=open+sans "rel ="stylesheet"type =" text/css"> "

" < script src =" https://AJAX.googleapis.com/AJAX/libs/jQuery/1.11.3/jQuery.min.js "> < / script > .

< / head >

< body >

< div id = 'bar Tools-Center' >

< ul >

"< id = li 'registry-top" > < a title = "Register online" style = "padding-left: 5px;" "href =" # "> save < /a > < /li >

"< id = li"customer account"> < a title ="Login to your account"href =" # "> my account < /a > < /li >".

"< id = li"top-support-launch"> < a title ="Ask for help"href =" # "> support < /a > < /li >".

< li > < a href = "#" > Accessability < /a > < /li >

< li > < a href = "#" > careers < /a > < /li >

< li > < a href = "#" > region change < /a > < /li >

"" "< img title ="go to our homepage"onMouseOver =" homeMouseRollover (this) "onMouseOut =" homeMouseOut (this) "src ="... / Icons/Icons/home153white.png Options Page "alt =" "/ >

"" < img title = "search our site" id = "search-site Internet-toggle" onMouseOver = "searchMouseRollover (this)" onMouseOut = "searchMouseOut (this)" src = "... Largeur/icons/Icons/magglasswhite.png Options Page' = "15px;" height = '15px'; alt = "" / >

< /ul >

< / div >

< / body >

Concerning

Todd

Definition:

An unordered list (UL) is made up of sequences of list items defined by the LI element.

In other words, the AMT must not contain anything that is not contained in an LI element. This means that it is illegal to an image in the OL element which is not contained in an LI element.

With respect to the highlighting of an item (LI) in the list, is to compare the href attribute of the element with the URL of the page. That is the href attribute is "register.html" then the URL is similar to www.mysite.com/register.html, then turn on the highest point. This can be achieved by using a bit of JavaScript.

I use jQuery to make the JS. The script looks like

{jQuery (document) .ready (function ($)}

var url = window.location.href;
$('_ul.nav_a').map (function () {}
$(this) .parent () .toggleClass ('active' this.href = url | this.href == url.split("?")) ([0].split("#") [0]);
});

});

The above script compares the values and assigns a class active in a game, although the game contains a hash (#) or an anchor. The style of the current class can be created using CSS as

.the {}

color: pink;

}

There are two required libraries, namely

  1. https://code.jQuery.com/jQuery-2.2.1.min.js
  2. jQuery - queryParser.js of GitHub - mattsnider/jquery-plugin-query-parser: Simple plugin for jQuery to parse query strings.

Tags: Dreamweaver

Similar Questions

Maybe you are looking for

  • When going to the next iTunes update?

    Screw the "how to write a good question", I'll be explicit enough here. I have an iPhone with the latest firmware 6. I have an iPod nano 7th generation with the last update of the firmware. I also have iTunes version 12.3.3.17. I've been using apple

  • How to reset the zoom automatically or the next time I open firefox or with an icon of the toolbar?

    I have - + toolbar, and when I press how to normal?and if I leave it to max the zoom, next time I open firefox, it keeps the zoom to the max! I want a toolbar icon to reset the Zoom

  • size of the string channel

    Hi all I have worked with a channel with the String data type and fill in the values with a script. This channel is really big, there was more 4 000 000 values long a few times. It worked perfectly fine last week. When I tried to run my script today

  • Pavilion 14-al011nd: gps chip HP Pavilion 14-al011nd

    Is there a GPS chip in the Pavilion 14-al011nd or a way to have a system of GPS tracking on the laptop? Hidden theft.

  • Start button does not work

    I have a Toshiba laptop.  I have recently upgraded to Windows 7, using all the programs compatibility of Microsoft and Toshiba.  I got the green light and the message that Windows was installed correctly.  Now, however, my Start button does work only