0

When I execute my functions the first one works fine and the second is called because I get my alert box but the second function does not execute. Any ideas why? Any input is appreciated.

function changeFont()
    {
                 <!--alert("changeFont function");-->
    document.getElementById("q4").style.fontStyle ="italic";

    }

    function changeFontBack()
    {
    alert("changeFontBack function");
    document.getElementById("q4").style.fontStyle="normal";
      }

<!-- this is the line it executes from -->

<p id="q4" onmouseOver="changeFont()" id ="q4"onClick="changeFontBack()">5. Part 1. Mouseover this paragraph to change the font to a font of you choice. Part 2. Click on this paragraph to return the font to the default font.</p>


    }

Edited by mike_2000_17: Fixed formatting

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by carlcarman
0

The alert box stops subsequent processing
comment out the alert box as it is in the prior script and it will work
or place the alert box after the function and it will work

0

The alert box stops subsequent processing
comment out the alert box as it is in the prior script and it will work
or place the alert box after the function and it will work

Thanks almostbob that did the trick. hard to believe I was that close

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.