Posts

Showing posts with the label HTML CSS Javascript

Change Text Color with Javascript at more that one part in single page.

Below code is the modified version of the topic name  Change Text Color with Javascript as one of the reader demands. Copy and paste the code in notepad and save it as any name with .html extension and run in browser. Logic behind to use the same feature in different parts of the page is by using class instead of id. Id is unique and cannot be used more than once but class can be used more than once to group the feature. The previous code uses ID and this one use Class on div. < html > < head >     < title > Text Color Change </ title >     < script type ="text/javascript" language ="javascript">         elmColor = 0;         function changeColor(elmColor) {             for (i = 0; i < document.getElementsByClassName( 'colorChange' ).length; i++) { ...

Change Css Class of li in ul onclick - Menu Linked Pages

Below code is posted on this blog on demand. This topic is modification of the topic Change Css Class of li in ul onclick Previous code sample is single page code. Now I have three different pages that are linked to three menu items. When Page One is clicked then menu Page One is highlighted and menupageone.html is navigated, when Page Two is clicked then menu Page Two is highlighted and menupagetwo.html and soon. menupageone.html – code , copy paste the below code and save with name menupageone.html <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head >     < meta http-equiv ="Content-Type" content ="text/html; charset=iso-8859-1" />     < title > List Item Menu - Query String </ title >     < style type ="text/css">     ...