Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Colour Demo</title>
<script type="text/javascript" language="javascript">
function toggleColour(objRadio){
var baseColour = "#000000";
var selectedColour = objRadio.value;
var parentElement = (objRadio.parentElement == null ? objRadio.parentNode : objRadio.parentElement);
var topElement = (parentElement.parentElement == null ? parentElement.parentNode : parentElement.parentElement);
var allElements = topElement.getElementsByTagName("div");
//Loop through all of the radio containing elements
for(var i = 0; i < allElements.length; i++){
//And set them to black.
allElements.item(i).style.color = baseColour;
}
//Then set the one that contains this radio to it's chosen colour
parentElement.style.color = selectedColour;
}
</script>
</head>
<body>
<div>
<div><input type="radio" value="#FF0000" name="colourSelection" onclick="toggleColour(this);" />Red</div>
<div><input type="radio" value="#00FF00" name="colourSelection" onclick="toggleColour(this);" />Green</div>
<div><input type="radio" value="#0000FF" name="colourSelection" onclick="toggleColour(this);" />Blue</div>
</div>
</body>
</html>