• Resolved ec18

    (@ec18)


    Hi,
    I have a blog located at http://ec18.wordpress.com

    Is it possible for me to use javascript in a page that I create?

    I looked through the codex and found that help on JS usage confusing. The script I am trying to use is

    <script type="text/JavaScript" language="JavaScript">
    <!--
    function expand(param)  {
    document.getElementById(param).style.display=(document.getElementById(param).style.display=="none")?"":"none";
    }//-->
    </script>
    At the top of the page and for individual instances of the above
    
    <a href="javascript:expand('dir1')">
                                    Text you want clicked >></a><br />
                                   <div id="dir1" style="display:none"><br />
                                   Text you want displayed when the above text is clicked.
                                   </div>

    The purpose of this is too have a dropdown when a link is clicked.

    I have tried adding this to the page but when I save the page the top Script part disappears and in the second part all > get converted to &gt

    Help please?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using Javascript on a wordpress.com hosted blog’ is closed to new replies.