XHTML Strict and textarea spellcheck

Discussion in 'HTML & Website Design' started by Themebot, Dec 18, 2009.

  1. #1
    I would like to turn off the built-in spellcheck functionality in certain browsers such as Firefox and Opera on a textarea that contains HTML embed code for visitors to copy and paste. This can be done with following attribute:

    However, this causes a validation error for XHTML Strict. Also, it doesn't work properly in Opera, because the spell checking returns after a user selects the embed code in the text area. Is there another method for turning off spell check functionality?
     
    Themebot, Dec 18, 2009 IP
  2. myst_dg

    myst_dg Active Member

    Messages:
    224
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Use Javascript:

    document.getElementById('textarea').setAttribute('spellcheck', 'false');

    or

    getElementsByTagName if there are more than 1 textarea, and for loop to set them all
     
    myst_dg, Dec 18, 2009 IP