Jump to content

dianefoster

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by dianefoster

  1. <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <style>
    #h1 {
    color: #000000;
    }
    </style>
    </head>
    <body>
    <h1 id ="h1">Discover Australia</h1>
    </body>
    </html>


    "use strict";
    function changeColour()
    {
    var heading = ["Discover"];
    for(var i =0;i<heading.lenght;i++)
    {
    heading = heading.split(" ");
    heading = heading.charAt(0).style.fontColor = "#F00";
    heading = heading.charAt(1).style .fontColor = "#F00";
    heading = heading.subString.style.fontColor = "#000";
    }
    var result = heading.join(" ");
    console.log(result);
    }
    document.getElementById("h1").addEventListener("onload", changeColour,false);

     

×
×
  • Create New...