On the right hand side you'll see a module called Tinker. Basically its a set javascript button that will change either the background color or the font color of the site. I'm trying to add a button that changes the header font color
Here is the code for the Javascript method.
changeBG
function changeBG(num){
document.body.style.backgroundImage = "";
document.bgColor = color[num];
I have a form which contains FOUR text fields (e.g. TEXTFIELD1, TEXTFIELD2, TEXTFIELD3 & TEXTFIELD4). Each text field holds a HEX,DEC color value. ABOVE this form I have a table with TWO ROWS (ROW1 and ROW2). ROW1 should correspond with TEXTFIELD1, so that when the VALUE in TEXTFEILD1 is changed the background color of ROW1 will change to match the HEX,DEC VALUE entered in TEXTFIELD1. The same would happen with TEXTFIELD2 and ROW2. TEXTFIELD3 should be used to change the color of the TEXT inside ROW1 and TEXTFIELD4 should change the color of the TEXT in ROW2. I also wanted to know if it would be possible to achieve this without clicking any button.
------------------------------------------------------------------ | ROW1 | TEXT IN ROW 1 ------------------------------------------------------------------ | ROW2 | TEXT IN ROW 2 ------------------------------------------------------------------
TEXTFIELD1 <----HEXDEC VALUE GOES HERE to change color of ROW1---->[code]....
I want the font color in the div to change color onclick and change back when clicked again. Tjis works only in IE but other browsers like FF and safari it changes color on click but does not change color back. I need it to work across.
how do I change the font color for certain elements of this javascript code that the client sees on their brower?
This is a count down script and I have made the code red that I am trying to change -
<script type="text/javascript"> var today=new Date() //Enter the occasion's MONTH (1-12) and DAY (1-31): var theoccasion=new Date(today.getFullYear(), 03, 21)
I need to do a few things onclick, but I'm having problems.1. Swap divs onclick of a text link in a list (found a script for this)2. Change the font color of the text link that is active, then change back to normal color when another text link is clicked. (found a script for this too)Even though I found separate scripts for each, I'm not smart enough to trouble shoot the conflicts when you put them on the same page. I can get one or the other working, but not sure how to combine them....??? I will paste the scripts below.
I'm trying to change the font color upon hovering of my CSS ID's #realmaturesingles and #seniorpeoplemeet. How do I do this using JavaScript? This is what I've tried.
I am using FrontPage 2003. How do I change the font, size, and color of the script? Here is the code I have:
<BODY
<SCRIPT> var date1 = "Feb 14, 2000" var mons = new Array("Jan", "Feb", "March", "April", "May", "June", "July", "August", "Sept", "Oct", "Nov", "Dec") var now = new Date(); var mm = now.getMonth(); mm = mons[mm]; var dd = now.getDate(); var yy = now.getYear(); var date2 = mm + " " + dd +", "+ yy;
function daysNoAccident() { date1 = date1.toString(); date2 = date2.toString(); date1 = Date.parse(date1); date2 = Date.parse(date2); date1 /= 1000; date1 /= 60; // minutes date2 /= 1000; date2 /= 60; var result = Math.abs(date1 - date2); result = result/60; // = hours result = result * 8/24; //hours worked per day result = result * 5/7; // working days in week result = result * 35 // number of employees result = parseInt(result); document.write ("You have worked " + result + " hours since 14th February 2000 without an accident"); } </SCRIPT>
When an ahref is clicked on a certain function is called. This function is called select_cresc(). The function works only on the else branch.When the Pret crescator a href is white it should be made grey when clicked on, but it does not work. How can this function only work on the else branch and not on the if branch, I just cannot figure it out.[code]So when i clicked the ahref once it sould be made white. When i click it again it should be made gray again. This last part does not work.
I have a form with 3 checkboxes. When user checks one of the boxes, additional fields show beneath the checkbox and the other 2 checkboxes are grayed out (locked). What I want is that when a user checks a checkbox, not only does the other 2 lock, but the text associated with them turn a different font color. I want it to appear as if the other checkboxes and text are being grayed out. BTW - I don't know any java, someone helped me with this and gave me this code so please try to be as specifica as possible.
For the lock function, I am using the following code:
<script language=JavaScript> var U=0;L=1; // (U)nlocked & (L)ocked function doIt(_v) { if(eval("document.bgcheck.c"+_v+".checked")) { if(_v==2){lock(3);lock(4);}
I'm using javascript to change the color of certain words in an html document. Right now it uses <font> to make the change. I would like to use a CSS class named "alert" from an external style sheet to make the change. I've tried multiple things but no luck (className="alert", setClassName="alert" ) What is the correct way to replace the font part with a CSS class? Here is the working script:
<script type = "text/javascript"> window.onload = function (){ var text = document.getElementsByTagName('body')[0].innerHTML; text = text.replace(/disabled/gi, "<font color=red>Disabled</font>" ); text = text.replace(/locked/gi, "<font color=red>Locked</font>" ); document.getElementsByTagName('body')[0].innerHTML = text; } </script>
I need to change the font color, font size & font face of some text assigned in a div. To do so I have a form select option menu at the top, adn below the menu three's 3/4 divs with some text. I need to change text properties of the div from select menu, and the page must not refresh. Its actually a little version of text editor.
I have a function that does some calculations and populates some text fields with the results. I also have a function that changes the font color of the numbers to red if they are less than zero. What I dont have is a way to make them work together. I imagine I need to pass the results of the calculation function to the change color function, but not sure how to go about doing that. Here is the calculation function:
function to calculate the total costs, gain/loss and return percent. function calculate() {
I want to implement a text input box for SMS text messages and the messages are limited to 160 characters (including spaces, etc.). I would like the font color of the text to be green as the user types and any text beyond 160 characters to be red. I would like to do this with one input box, the same box that the user is typing in not a separate display box. This will be on the users local PC it won't be on the Internet.
I am building an online survey using a survey creation tool which allows me to incorporate javascript for additional functionality. However, I am new to javascript so would appreciate any help that you could provide me with.
I have question types like agreement scales, where the respondent sees a list of statements and has to rate each one by clicking on a radio button. The source code of the matrix table looks like this:
[Code].....
This code works as intended; however, as you can see, it loops through all the radio buttons when one is clicked. Is there a way to accomplish this without looping through all the radios, and thus make the script run faster?
Also, I have read that the addEventListener function does not work for older versions of IE. Is there a simpler alternative?
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:
We are working within a CMS and we have a dynamic text header that pulls into the top of the page. The problem is that there are certain titles that are too long and are breaking into other design elements. I'm thinking there should be a way to count the number of characters and then dynamically change the font-size of the header.
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)
I'm trying to make buttons that change from one color to another when you click them and change back when you click them a third time. I wrote this page (http://cf.lehigh.edu/ems/test.html) but it only works on Firefox(Not IE or Chome, untested on safari or Opera). I'm using javascript to change the button colors. Is there another way to do this that works universal or another tool such as CSS?
I'm trying to create a cell in a table which changes color depending which radio button is checked.
I found the following code which works for different cells but it doesn't work when the buttons are in the same cell. Think you'll see what i mean. I'm not too hot when it comes to Javascript though so i don't know how to adapt what I've got so far. Code:
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.
Below is a script for a simple site search for which I would like to be able to change the font face and/or color for the research results produced by the script.? Code:
I am trying to change the font color of each character of the innerHTML of a div. I have tried the following but obviously I have not gotten it to work.
This is just a snapshot of the javascript which I have that "changes the color and size of the characters..
Code:
function change() { var r = 0; var len = document.getElementById("userInput").value.length;
My code changes the font color of a table row to red when a checkbox is checked, and reverts when unchecked. I need to apply this to the text in a specific DIV rather than the checkbox row. I also need the text to fade to red then revert each time a checkbox changes state, rather than stay red and revert when unchecked. I basically want to draw users attention to a totals panel whenever there is checkbox activity.
I am trying to figure ou how to have a page where a client can input some text, then select a font type and color and possibly an outline(?) and have the page display their text with their selections (I hope that makes since-like if they choose 'Hi' in blue text, veranda style it would actually display the text in blue in the font face chosen), and from what I gather, I may be able to achieve this using javascript with css, but I'm not sure where to start?