Title: Using Javascript on a wordpress.com hosted blog
Last modified: August 19, 2016

---

# Using Javascript on a wordpress.com hosted blog

 *  Resolved [ec18](https://wordpress.org/support/users/ec18/)
 * (@ec18)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/using-javascript-on-a-wordpresscom-hosted-blog/)
 * Hi,
    I have a blog located at [http://ec18.wordpress.com](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)

 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/using-javascript-on-a-wordpresscom-hosted-blog/#post-836559)
 * > I have a blog located at [http://ec18.wordpress.com](http://ec18.wordpress.com)
 * you are at the wrong forum.
 * [http://www.google.com/search?hl=en&q=wordpress.com+support&btnG=Google+Search](http://www.google.com/search?hl=en&q=wordpress.com+support&btnG=Google+Search)
 * 3rd link.
 *  Thread Starter [ec18](https://wordpress.org/support/users/ec18/)
 * (@ec18)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/using-javascript-on-a-wordpresscom-hosted-blog/#post-836582)
 * ah sorry bout that.
    Thanks for the link

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

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

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [ec18](https://wordpress.org/support/users/ec18/)
 * Last activity: [17 years, 9 months ago](https://wordpress.org/support/topic/using-javascript-on-a-wordpresscom-hosted-blog/#post-836582)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
