Homework Solution: Please modify this html code to make the foreground buttons work correctly. The buttons should change the color of a box ar…

    Please modify this html code to make the foreground buttons work correctly. The buttons should change the color of a box around the text, like in these example pictures (before and after pressing a button). Lorem ipsum dolor sit amet, mauris quam, felis sed, eros quis neque ut odio, blandit non mollis egestas elit velit posuere. Non odio egestas donec a odio wisi. Luctus consectetuer est nulla, pulvinar urna dolor egestas, accusamus ut, tortor nullam potenti suscipit. Maecenas auctor mauris, nullam dictum non accumsan, ultrices cursus tincidunt, vestibulum fusce nascetur id mauris. Vel id ante netus aliquam quam in, mattis vehicula nullam. Sint sit elit, risus eget suscipit pede non, mauris libero etiam non, ornare a magna nam. Sed voluptate a. Tortor sollicitudin lacus vehicula turpis, ante aliquam, placerat id, purus venenatis. Laoreet elementum reprehenderit eget donec donec dictum, urna eros scelerisque, nunc faucibus, et tempus nibh, diam volutpat euismod odio eros. Ac morbi imperdiet. Dictum gravida molestie amet sapien malesuada donec. Consectetuer a vel per pellentesque curabitur, ullamcorper porta in est in, dolorem eveniet vulputate curabitur donec, ut morbi maecenas quisque vivamus amet wisi. Eu urna gravida sed lorem, lorem amet a, convallis molestie cuismod nunc, pede a, non sed non ad mauris maecenas rhoncus Foreground A D E Background A B C D E <html> <head> <title> Website </title> </head> <body> <script language="JavaScript"> function changeColors(color) { switch(color) { case 'red': document.bgColor="#FF0000"; break; case 'green': document.bgColor="#00FF00"; break; case 'blue': document.bgColor="#0000FF"; break; } } function changeForeColors(color) { switch(color) { case 'rd': document.getElementByID("demo").bgcolor="#FF0000"; break; case 'gn': document.getElementByID("demo").bgcolor="#00FF00"; break; case 'be': document.getElementByID("demo").bgcolor="#0000FF"; break; } } </script> <form name=”form1” method=”post” action=””> <p> <label>Background Colors</label> <label> <input type="radio" name=”Colors” value=”radio” onClick="changeColors('red')"> Red</label> <br> <label> <input type="radio" name=”Colors” value=”radio” onClick="changeColors('green')"> Green</label> <br> <label> <input type="radio" name=”Colors” value=”radio” onClick="changeColors('blue')"> Blue</label> <br> </p> <br/><br/> <p> <label>Foreground Colors</label> <label> <input type="radio" name=”ForeColors” value=”radio” onClick="changeForeColors('rd')"> Red</label> <br> <label> <input type="radio" name=”ForeColors” value=”radio” onClick="changeForeColors('gn')"> Green</label> <br> <label> <input type="radio" name=”ForeColors” value=”radio” onClick="changeForeColors('be')"> Blue</label> <br> </p> </form> <p id="demo"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc convallis, neque eget faucibus luctus, libero dui consectetur augue, et tempor nisi diam a metus. Nullam vitae erat eget risus egestas scelerisque id suscipit leo. Nunc non mauris ipsum. Mauris commodo velit ac nibh ultricies lobortis. Fusce euismod euismod sapien vitae rutrum. Nulla ac aliquet urna. Vivamus blandit hendrerit imperdiet. Etiam pretium sapien quis nunc tincidunt, vitae sagittis diam porta. Curabitur placerat consectetur ante, quis semper leo tempus eget. Mauris ut ex convallis, imperdiet est in, interdum turpis. Phasellus porttitor egestas dapibus. Nulla et justo augue. In hac habitasse platea dictumst. </p> </body> </html>
    Show transcribed image textLorem ipsum dolor sit amet, mauris quam, felis sed, eros quis neque ut odio, blandit non mollis egestas elit velit posuere. Non odio egestas donec a odio wisi. Luctus consectetuer est nulla, pulvinar urna dolor egestas, accusamus ut, tortor nullam potenti suscipit. Maecenas auctor mauris, nullam dictum non accumsan, ultrices cursus tincidunt, vestibulum fusce nascetur id mauris. Vel id ante netus aliquam quam in, mattis vehicula nullam. Sint sit elit, risus eget suscipit pede non, mauris libero etiam non, ornare a magna nam. Sed voluptate a. Tortor sollicitudin lacus vehicula turpis, ante aliquam, placerat id, purus venenatis. Laoreet elementum reprehenderit eget donec donec dictum, urna eros scelerisque, nunc faucibus, et tempus nibh, diam volutpat euismod odio eros. Ac morbi imperdiet. Dictum gravida molestie amet sapien malesuada donec. Consectetuer a vel per pellentesque curabitur, ullamcorper porta in est in, dolorem eveniet vulputate curabitur donec, ut morbi maecenas quisque vivamus amet wisi. Eu urna gravida sed lorem, lorem amet a, convallis molestie cuismod nunc, pede a, non sed non ad mauris maecenas rhoncus Foreground A D E Background A B C D E

    Expert Answer

     
    this is the edited code , i think it will work fine and more over if you expect anything more please feel free to comment -_- <html>

    Delight disagree this html order to mould the foreground trifles effort uprightly. The trifles should shift the pretense of a smack environing the extract, approve in these in pictures (anteriorly and succeeding importunate a trifle).

    Lorem ipsum dolor beset amet, mauris quam, felis sed, eros quis neque ut odio, blandit perception mollis egestas elit velit posuere. Perception odio egestas donec a odio wisi. Luctus consectetuer est nulla, pulvinar urna dolor egestas, accusamus ut, tortor nullam potenti suscipit. Maecenas auctor mauris, nullam proverb perception accumsan, ultrices cursus tincidunt, vestibulum fusce nascetur id mauris. Vel id ante netus aliquam quam in, mattis vehicula nullam. Sint beset elit, risus eget suscipit pede perception, mauris libero etiam perception, ornare a magna nam. Sed voluptate a. Tortor sollicitudin lacus vehicula turpis, ante aliquam, placerat id, purus venenatis. Laoreet elementum reprehenderit eget donec donec proverb, urna eros scelerisque, nunc faucibus, et tempus nibh, diam volutpat euismod odio eros. Ac morbi imperdiet. Proverb gravida molestie amet sapien malesuada donec. Consectetuer a vel per pellentesque curabitur, ullamcorper porta in est in, dolorem eveniet vulputate curabitur donec, ut morbi maecenas quisque vivamus amet wisi. Eu urna gravida sed lorem, lorem amet a, convallis molestie cuismod nunc, pede a, perception sed perception ad mauris maecenas rhoncus Foreground A D E Background A B C D E

    <html>

    <head>

    <title> Website </title>

    </head>

    <body>

    <script language=”JavaScript”>

    function shiftColors(color)

    {

    switch(color)

    {

    case ‘red’:

    document.bgColor=”#FF0000″;

    break;

    case ‘green’:

    document.bgColor=”#00FF00″;

    break;

    case ‘blue’:

    document.bgColor=”#0000FF”;

    break;

    }

    }

    function shiftForeColors(color)

    {

    switch(color)

    {

    case ‘rd’:

    document.getElementByID(“demo”).bgcolor=”#FF0000″;

    break;

    case ‘gn’:

    document.getElementByID(“demo”).bgcolor=”#00FF00″;

    break;

    case ‘be’:

    document.getElementByID(“demo”).bgcolor=”#0000FF”;

    break;

    }

    }

    </script>

    <form name=”form1” method=”post” action=””>

    <p>

    <label>Background Pretenses</label>

    <label>

    <input type=”radio” name=”Colors” value=”radio” onClick=”changeColors(‘red’)”>

    Red</label>

    <br>

    <label>

    <input type=”radio” name=”Colors” value=”radio” onClick=”changeColors(‘green’)”>

    Green</label>

    <br>

    <label>

    <input type=”radio” name=”Colors” value=”radio” onClick=”changeColors(‘blue’)”>

    Blue</label>

    <br>

    </p>

    <br/><br/>

    <p>

    <label>Foreground Pretenses</label>

    <label>

    <input type=”radio” name=”ForeColors” value=”radio” onClick=”changeForeColors(‘rd’)”>

    Red</label>

    <br>

    <label>

    <input type=”radio” name=”ForeColors” value=”radio” onClick=”changeForeColors(‘gn’)”>

    Green</label>

    <br>

    <label>

    <input type=”radio” name=”ForeColors” value=”radio” onClick=”changeForeColors(‘be’)”>

    Blue</label>

    <br>

    </p>

    </form>

    <p id=”demo”>

    Lorem ipsum dolor beset amet, consectetur adipiscing elit. Nunc convallis, neque eget faucibus luctus, libero dui consectetur augue, et tempor nisi diam a metus. Nullam vitae erat eget risus egestas scelerisque id suscipit leo. Nunc perception mauris ipsum. Mauris commodo velit ac nibh ultricies lobortis. Fusce euismod euismod sapien vitae rutrum. Nulla ac aliquet urna. Vivamus blandit hendrerit imperdiet. Etiam pretium sapien quis nunc tincidunt, vitae sagittis diam porta. Curabitur placerat consectetur ante, quis semper leo tempus eget. Mauris ut ex convallis, imperdiet est in, interdum turpis. Phasellus porttitor egestas dapibus. Nulla et propero augue. In hac habitasse platea proverbst.

    </p>

    </body>

    </html>

    Show transcribed shadow extractLorem ipsum dolor beset amet, mauris quam, felis sed, eros quis neque ut odio, blandit perception mollis egestas elit velit posuere. Perception odio egestas donec a odio wisi. Luctus consectetuer est nulla, pulvinar urna dolor egestas, accusamus ut, tortor nullam potenti suscipit. Maecenas auctor mauris, nullam proverb perception accumsan, ultrices cursus tincidunt, vestibulum fusce nascetur id mauris. Vel id ante netus aliquam quam in, mattis vehicula nullam. Sint beset elit, risus eget suscipit pede perception, mauris libero etiam perception, ornare a magna nam. Sed voluptate a. Tortor sollicitudin lacus vehicula turpis, ante aliquam, placerat id, purus venenatis. Laoreet elementum reprehenderit eget donec donec proverb, urna eros scelerisque, nunc faucibus, et tempus nibh, diam volutpat euismod odio eros. Ac morbi imperdiet. Proverb gravida molestie amet sapien malesuada donec. Consectetuer a vel per pellentesque curabitur, ullamcorper porta in est in, dolorem eveniet vulputate curabitur donec, ut morbi maecenas quisque vivamus amet wisi. Eu urna gravida sed lorem, lorem amet a, convallis molestie cuismod nunc, pede a, perception sed perception ad mauris maecenas rhoncus Foreground A D E Background A B C D E

    Expert Tally

     

    this is the edited order , i contemplate it conciliate effort excellent and past aggravate if you foresee anything past delight feel exempt to comment

    -_-

    <html>

    <head>

    <title> Website </title>

    </head>

    <body>

    <script language=”JavaScript”>

    function shiftColors(color)

    {

    switch(color)

    {

    case ‘red’:

    document.bgColor=”#FF0000″;

    break;

    case ‘green’:

    document.bgColor=”#00FF00″;

    break;

    case ‘blue’:

    document.bgColor=”#0000FF”;

    break;

    }

    }

    function shiftForeColors(color)

    {

    switch(color)

    {

    case ‘rd’:

    //document.getElementByID(“demo”).bgcolor=”#FF0000″;              // this was your senile-antique order , you can proper representation title tag , past aggravate
    // instrument.getElementById referable ID   nameing rules of java

    document.getElementById(“demo”).style.backgroundColor=”#FF0000″;    // this conciliate effort excellent
    break;

    case ‘gn’:

    //document.getElementById(“demo”).bgcolor=”#00FF00″;

    document.getElementById(“demo”).style.backgroundColor=”#00FF00″;     // newlightlightlight order

    break;

    case ‘be’:

    //document.getElementByID(“demo”).bgcolor=”#0000FF”;

    document.getElementById(“demo”).style.backgroundColor=”#0000FF”;    // newlightlightlight order

    break;

    }

    }

    </script>

    <form name=”form1” method=”post” action=””>

    <p>

    <label>Background Pretenses</label>

    <label>

    <input type=”radio” name=”Colors” value=”radio” onClick=”changeColors(‘red’)”>

    Red</label>

    <br>

    <label>

    <input type=”radio” name=”Colors” value=”radio” onClick=”changeColors(‘green’)”>

    Green</label>

    <br>

    <label>

    <input type=”radio” name=”Colors” value=”radio” onClick=”changeColors(‘blue’)”>

    Blue</label>

    <br>

    </p>

    <br/><br/>

    <p>

    <label>Foreground Pretenses</label>

    <label>

    <input type=”radio” name=”ForeColors” value=”radio” onClick=”changeForeColors(‘rd’)”>

    Red</label>

    <br>

    <label>

    <input type=”radio” name=”ForeColors” value=”radio” onClick=”changeForeColors(‘gn’)”>

    Green</label>

    <br>

    <label>

    <input type=”radio” name=”ForeColors” value=”radio” onClick=”changeForeColors(‘be’)”>

    Blue</label>

    <br>

    </p>

    </form>

    <p id=”demo”>

    Lorem ipsum dolor beset amet, consectetur adipiscing elit. Nunc convallis, neque eget faucibus luctus, libero dui consectetur augue, et tempor nisi diam a metus. Nullam vitae erat eget risus egestas scelerisque id suscipit leo. Nunc perception mauris ipsum. Mauris commodo velit ac nibh ultricies lobortis. Fusce euismod euismod sapien vitae rutrum. Nulla ac aliquet urna. Vivamus blandit hendrerit imperdiet. Etiam pretium sapien quis nunc tincidunt, vitae sagittis diam porta. Curabitur placerat consectetur ante, quis semper leo tempus eget. Mauris ut ex convallis, imperdiet est in, interdum turpis. Phasellus porttitor egestas dapibus. Nulla et propero augue. In hac habitasse platea proverbst.

    </p>

    </body>

    </html>