Onclick Link Change Text Color

Aug 11, 2011

I have a page here [url]. What I want to control is that for link on the left that is clicked I want the text to change to a particular color to highlighted it have been selected. And when another linked is clicked I want the previous linked to be reset to the normal color.

View 4 Replies


ADVERTISEMENT

Onclick Link Change Text Color ?

Aug 11, 2011

I have a page here [url]. What I want to control is that for link on the left that is clicked I want the text to change to a particular color to highlighted it have been selected. And when another linked is clicked I want the previous linked to be reset to the normal color. How to achieve that.

View 2 Replies View Related

Change Text Color Of A Link With Onclick Event

Jul 20, 2005

I created 3 hyperlinks, when the user click each link, it will change
the color of the text of a link. For example, when user clicks Link1,
text Link1 will become red color, but Link2 and Link3 unchange. Here's
my attempts, any ideas??

<script language="javascript">
function changecolor (i)
{
document.i.fontcolor = red;
}
</script></head><a name="item1" href="test.html"
onClick='changecolor(item1)'>Link 1</a><a name="item2"
href="test.html" onclick='changecolor(item2)'>Link 2</a><a
name="item3" href="test.html" onclick='changecolor(item3)'>Link 3</a>

View 5 Replies View Related

Change The Background-color Of The Link Onclick?

Oct 11, 2011

l have got a series of menus. What l want to do is change the background-color of the link onclick.

What l have done use jquery like this

jQuery('.menu a').click(function(){
var clz = jQuery(this).attr('id');
jQuery(this).attr('class','active'+clz);
})

This is not work.The code needs to work on mobile phones

View 3 Replies View Related

JQuery :: Hover Doesn't Work When Change The Text Color Of A Link?

Sep 11, 2011

I have a simple menu as you can see in which i want the link that gets pressed to change color to grey.(line26).But before that (line25) i use jquery to change all the links back to their original color.But that line of code destroys my hover effect on all my links for a reason.

<head>
<style>
.link {
color: #fff;

[Code].....

View 3 Replies View Related

Change Link URLs With Text OnClick

Sep 27, 2011

Any way to update URLs on a page depending on the region selected by the user. I have 3 regions, Americas, Europe & Asia. And depending on the region selected I need to update URLs on the page for the different regions.

For example, below are the 3 possibilities for the links.
domain.com/americas/product.php
domain.com/asia/product.php
domain.com/europe/product.php

View 8 Replies View Related

Code To Just Underline Linked Text To A Certain Color (red) But Doesn't Change The Text Color?

Mar 26, 2009

Is there code to just underline linked text to a certain color (red) but doesn't change the text color (it was white & when hovered over, it still stays white with a red underline)?

View 4 Replies View Related

Change Text Color For One Document.write But Not Color Of All Text?

Jul 23, 2005

I want to make the date at the top right darker blue. But when I do that, all the light blue text next to the pictures also changes.

How can I control the color of the result of document.write output without changing the forground color of the entire page? Note my document write includes variables, so I was hesitant to imbed an html command in the document.write.

View 7 Replies View Related

JQuery :: AddClass - Change The Color Of Surrounding Text Of The Disabled Radio Button To The Color Grey

Feb 8, 2010

I have this markup:

[Code]...

There are two radio buttons, sometimes one will be disabled, other times the other will be disabled. I would like to make a script that: First: Changes the color of surrounding text of the disabled radio button to the color grey. Second: Checks the other radio button.

This was my plan: I would make a script that: First: Removes all the current classes and add the class "greyed_out" (or better: change only the color of) the parent element, all siblings and children of siblings (if any) of the radio button that is disabled at that time.Second: Sets the attribute "checked to the other radio button". I made a script, but when I set the bottom radio button to disabled the script doesn't work:

[Code]...

View 4 Replies View Related

Can't Change CSS Style For "onClick" Text Link

Jun 24, 2007

Greetings. I am using this code for a photo gallery.

<script language="JavaScript">
function LoadGallery(pictureName,imageFile,titleCaption,captionText)
{
if (document.all)
{

[Code].....

It totally works but I would like to have the "Link" when clicked change from the style designated in the <td> tag below:

<td class="style 1">

To another CSS style .style 2

I am stuck on how to get this to work. I have tried many things with no luck. Do I need another function or could it be added to my gallery script?

View 7 Replies View Related

Change Button Color With Onclick Function?

Aug 22, 2011

I want to change the color of a button when it is clicked and have added this getElementById line in the function called by onclick but when I add the line the function won't run. The function also contains AJAX to change the button content but everything else is working fine as long as I don't add this line.

Code:
<input type = "button" id = "alternative1" value="$alt1" onClick="changeQuestion('alternative1')">
function changeQuestion(answer)

[Code]....

View 4 Replies View Related

Change Color Onclick For Default Textbox Value?

Jan 11, 2011

I've been trying to make a default value in a text box go away when clicked.

The general consensus on this forum and on the rest of the internet seems to be that this code:

<script>
function clearText(field){
if (field.defaultValue == field.value) field.value = ''
else if (field.value == '') field.value = field.defaultValue;

[Code]....

But I wonder how I can add a color change to this function. They default value "enter email address here" would be in grey, but when the user begins to type, it would be black. then deleted what'd been typed, back to grey.

document.getElementById(email_box).style.color='#000000'; .....is that too nave..? It didn't work no matter where I put it. And dreamweaver didn't like it when I tried to copy the syntax of the first function, but make it change colors instead. It furthermore hated me trying to assign two different functions to the onClick event.

It also didn't like at all when I tried to apply two classes to the same object..

View 3 Replies View Related

Change The Color Of A Link After It Has Been Clicked On WITHOUT Using CSS

Aug 22, 2009

I am trying to change the color of a link after it has been clicked on WITHOUT using CSS.

When the link is clicked some javascript is called. I can do this in IE by adding this "this.style.color = 'black'". However this doesn't work in other browsers. Anyone know how I could get this to work in other browsers?

View 2 Replies View Related

Change Link Color With .className

Feb 19, 2009

I am using some code I found on the internet to make all my external links in a new window. Also, I want to make these links gray. I think I once heard you coulden't change link colors at all once a page was loaded, but I may be wrong. In any case, it won't work.

Here is my code:

Now I find I can't make them open in a new window either.

View 1 Replies View Related

Change Color Of Link Depending Whether It - A Certain Value

Jul 8, 2009

I am trying to create a list of customers that we do weekly reports for. What I would like to do is if the current date falls in between $date (variable of last updated report) and $date+7 (i.e. a week later) then display the text in green else display text in red.

View 1 Replies View Related

JQuery :: Change Link Color On Click?

Oct 4, 2011

I've got 2 scripts for my website. The first is an AJAX script which loads the different pages when the links are clicked. The second scriptfades content in and out on the home page when another set of links are in.

I'm struggling to change the color of both sets of links when they're clicked.

Here's the code:

$(document).ready(function() {
//AJAX: loading contens of pages
var hash = window.location.hash.substr(1);
var href = $('#nav li a').each(function(){

[Code].....

View 2 Replies View Related

Change Active Link Color On Div Swap

Mar 19, 2011

I've been able to develop the content div swap for the following test site, [url], but can't figure out how to highlight the active name in the left-hand sub-navigation.

Here's the code...

HTML Code:

View 2 Replies View Related

Changing Textbox Text Color Onclick

Dec 23, 2010

I have a textbox thats initial text color is set to grey, I want to change the text color to black when the user clicks on it, is this done by using onclick="style=color:Black;" I have tried this and failed but maybe ive got something slightly wrong or is it done a different way completely.

View 7 Replies View Related

JQuery :: Change Current Link Opacity And Color

Oct 18, 2011

I've got this script which effectively should change the clicked link's opacity to full and its siblings' opacity to 0.6. The only part that works though is the changing the text color to black. Here's the script:

<script type="text/javascript">
$(document).ready(function(){ $(".menu a").live('click',function(){
$(this).siblings().css('color','red');
$(this).css('color','black');
$(this).css('opacity',1);
[Code]....

View 3 Replies View Related

Show / Hide Div Layer / Change Link Color / When Radio Button Is Selected

Aug 16, 2010

I am trying to develop an exam system.Find my code below.I request you to copy the code and save it as an html file .I have 2 problems:

1. Kindly notice that when the quiz is loaded,it shows both the questions by default.I want only question 1 to be visible when the quiz loads.What happens presently is that ,both questions are visible even after I click on the link
Q.1( referring to question 1).However,when I click on
Q. 2,then only question 2 can be seen and then(after clicking on Q.2) if I click on Q.1,then only question 1 can be seen

What I want is that when the page loads only question 1 is visible.Then when I click on Q.2,I can see only question 2 and when I click on Q.1, I can see only question 1.I later plan on adding many questions,so it should be a general solution rather than a solution good only for 2 questions.

2.Also,what I want is that,if someone selects any of the answers of a particular question,it's link color should turn green to indicate to the user that he answered that question.So for,instance,if I select an answer to the first question(select one of London,New York,Seattle,Washington,Chicago), the link Q.1 should turn green.

View 3 Replies View Related

JQuery :: Change The Color Of My Text?

Apr 5, 2011

I am currently trying to change the color of my text in jquery. The problem im having is im not sure how to change my color back to the original css color when I click on the other link. Instead the color just remains and does not go away.(By the way im not strong on this language so keep it simple for me)Here is my code:

$('#navigation ul.submenu li a.sug').click(function() {
$('#navigation ul.submenu li a.sug').css("color","#e1519f");
});[code]......

View 2 Replies View Related

Change Text Color When Value Is Equal?

Oct 1, 2009

I am working on a multiplication table and it is suppose to allow you to enter a value, and then if the value is correct, the text color will turn green, if it is incorrect the value will turn red, it isn't doing anything, I am not that good in programming with Javascript, so I think it's probably something with my code, all the elements are named properly the are all input fields.

function checkMath(s,n)
{
if(document.getElementsByName("math_"+n.toString()+"t"+s.toString()).value == s * n)

[code]....

View 1 Replies View Related

JQuery :: To Change Text Color?

Jun 9, 2010

I am trying to get a header, to fade between colors, from red - orange - green - blue for example.

Someone told me that jquery might be able to handle this as I dont want to use flash.

View 7 Replies View Related

GetElementId Change Color Of Text?

Nov 6, 2011

I have been playing with javascript and I have one issue I can't workout. below in my code on a click the td will change its background image and text color. The issue I have I can't get the color to work but the image is find.

Code:
<td>
<a href="javascript:cont(specialId)" class="position-one"><span>water</span></a>
</td>

[Code]....

View 5 Replies View Related

Text Color Doesnt Change ?

Jan 7, 2011

I grab Jquery scroll bar demo from htmldrive.com and try to work it out for myself. But when I modify the coding, some text color doesn't change as it suppose to be. I am not sure where is the problem. The function is as the following

The original sample is here: [url]

View 2 Replies View Related

Change Color Of Text Field ?

Apr 17, 2011

Can you control the color of a text field using JavaScript? I want to change the color of a text field in my current application.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved