Grammar check on static pages (Using Chrome)
Have you ever had to check the grammar on a static page? I know Chrome has spellchecking, but it doesn't affect non editable stuff like p
s and h1
s and etc.
So what know? This is what I did. Open your page on Chrome and hit the secret suquence ctrl+shift+J
.
Then make all stuff editable and enable spellchecking!
$('p, h1, h2, h3, h4, h5, h6, a, button, ETC')
.attr('spellcheck', 'true')
.attr('contenteditable', 'true')
Or with plain JS:
var tag_names = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
for (var x in tag_names) {
var tag_name = tag_names[x];
var elements = document.getElementsByTagName(tag_name);
for (var x1 in elements) {
var element = elements[x1]
element.setAttribute('spellcheck', 'true');
element.setAttribute('contenteditable', 'true');
}
}
Written by Nicolas Oga
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Html
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#