Span onclick

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • UKuser

    #1

    Span onclick

    Hi,

    I managed to get a script working earlier with a span onclick
    function, however for whatever reason Firefox is just not playing
    ball. A very simple test script is:

    <html>
    <script>
    function tell(){
    alert('test')
    }
    </script>

    <p><span style="float:le ft;width:100px; background-color:red"
    onclick='return tell();'>hello</span></p>

    </html>

    In IE this works fine but not my FF. I've restarted the program and as
    I say - managed to get it working. Just annoying me that its not
    working now.

    Thanks

    A
  • UKuser

    #2
    Re: Span onclick

    On Feb 20, 11:12 am, UKuser <spiderc...@yah oo.co.ukwrote:
    Hi,
    >
    I managed to get a script working earlier with a span onclick
    function, however for whatever reason Firefox is just not playing
    ball. A very simple test script is:
    >
    <html>
    <script>
    function tell(){
    alert('test')
    }
    </script>
    >
    <p><span style="float:le ft;width:100px; background-color:red"
    onclick='return tell();'>hello</span></p>
    >
    </html>
    >
    In IE this works fine but not my FF. I've restarted the program and as
    I say - managed to get it working. Just annoying me that its not
    working now.
    >
    Thanks
    >
    A
    IGNORE ME - it doesnt help turning of Javascript for test purposes and
    forgetting to turn it back on!!

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Span onclick

      UKuser wrote:
      On Feb 20, 11:12 am, UKuser <spiderc...@yah oo.co.ukwrote:
      >[...]
      > <p><span style="float:le ft;width:100px; background-color:red"
      >onclick='retur n tell();'>hello</span></p>
      >>
      ></html>
      >>
      >In IE this works fine but not my FF. I've restarted the program and as
      >I say - managed to get it working. Just annoying me that its not
      >working now.
      >[...]
      >
      IGNORE ME - it doesnt help turning of Javascript for test purposes and
      forgetting to turn it back on!!
      Hopefully this helps you to see the *actual* error of your approach.


      PointedEars
      --
      realism: HTML 4.01 Strict
      evangelism: XHTML 1.0 Strict
      madness: XHTML 1.1 as application/xhtml+xml
      -- Bjoern Hoehrmann

      Comment

      Working...