spelling-markers-008.html (847B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <meta charset="utf-8"> 4 <title>Turning off spellcheck by making textareas disabled</title> 5 <link rel=match href="references/spelling-markers-001-ref.html"> 6 <link rel=help href="https://html.spec.whatwg.org/multipage/interaction.html#spelling-and-grammar-checking"> 7 <meta name=assert content="Spellchecking stops applying to textareas when they become disabled"> 8 9 <style> 10 #test { 11 /* Match the ref */ 12 all: initial; 13 width: 100%; 14 display: block; 15 font-family: inherit; 16 } 17 </style> 18 19 <textarea id=test>This test passes if there is no visual marker indicating the spellinnnnnggg mistake in this sentence, and fails otherwise.</textarea> 20 21 <script> 22 var test = document.getElementById("test"); 23 // Force spellcheck by focus then blur 24 test.focus(); 25 test.blur(); 26 test.setAttribute("disabled", true); 27 </script>