• Hello, im making a shortcode plugin that adds some tables with some data. I want to be able to hide/show the tables easily, so i print this in the shortcode function. The problem is, the javascript that should be executed by the href=”javascript: switchVisibility(competition87);” is not! Anybody knows what am i doing wrong?

    <script type="text/javascript">
    function switchVisibility(obj)
    {
      if (obj.style.display == "none")
        obj.style.display = "";
      else
        obj.style.display = "none";
    }</script>
      <a href="javascript: switchVisibility(competition87);">test</a>
      <div id="competition87" style="display:none;">
        some contents
      </div>
    ...

    ps: the above code is from a post in which ive writen the shortcode

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘shortcode plugin javascript doesnt work’ is closed to new replies.