document.designMode
? Victor Ayomipo explains how it can be used to view content changes and demonstrate more use cases where it comes well with everything from basic content editing to improving team collaboration.
So you just implemented a change on your site. Congratulations! Everything went according to plan, but now that you look at your work in production, you begin to question your change. Maybe this change was as simple as a new headline and doesn’t seem to fit the room. Maybe you added a picture, but it just doesn’t feel right in the specific context.
What are you doing? Do you start implementing more changes? It is not like you need to crack open illustrator or Figma to mock up on a small change like that, but to preview your changes before implementing them would still be useful.
Enter document.designMode
. It’s not new. Actually I recently came on it for the first time and had one of them “Wait, this exists?” Moments, because it is a tool we have had forever, even in Internet Explorer 6. But for some reason I only hear about it, and it turns out that many of my colleagues also hear about it for the first time.
What is exactly document.designMode
? Maybe a small video demonstration can help demonstrate how it allows you to make direct edits to a page.
document.designMode
Works.On the simplest, document.designMode
Does web pages are edited, similar to a text. I would say it’s like having An edit mode for the Internet – You can click anywhere on a web page to change existing text, move things around and even delete items. It’s like having Apple’s “distraction control” feature on your Beck and call.
I think this is a useful tool for developers, designers, clients and ordinary users.
You may be wondering if this is like contentEditable
Because with a moment they both look. But no, the two serve different purposes. contentEditable
is more focused on making a specific element edible document.designMode
Do The whole Page Editable.
Activation document.designMode
Can be performed in the browser’s developer tools:
- Right -click everywhere on a web page and click Inspect.
- Click Console The tab.
- Type
document.designMode = "on"
and press Enter.
To turn it off, you need to update the page. That’s it.
Another method is to create a bookmark that activates the condition when clicked:
- Create a new bookmark in your browser.
- You can name it regardless, e.g. “Edit_mode”.
- Enter this code in the URL field:
javascript:(function(){document.designMode = document.designMode === 'on' ? 'off' : 'on';})();
And now you have a switch that changes document.designMode
To and from.
Use cases
There are many interesting, creative and useful ways to use this tool.
Basic content editing
I dare say that this is the central purpose of document.designMode
which essentially edits any text element on a web page for whatever reason. It can be headlines, paragraphs or even ball points. Notwithstanding anything to the case, your browser effectively becomes a “What you see is what you get” (wysiwyg) editorwhere you can make and view changes on site.
document.designMode
.Landingside A/B test
Let’s say we have a product site with an existing copy, but then you check your competitors and their copy looks more appealing. Of course you will test it out. Instead of editing on the back or noting for later, you can use document.designMode
To immediately see how that copying variation would fit into the layout of the destination page and then easily compare and contrast the two versions.
document.designMode
.This can also be useful for copywriters or solo developers.
SEO -Title and Meta description
Everyone wants their site to rank at the top of the search results because it means more traffic. As wide as SEO is like a practice,
Take and Description is a site’s first impression in search results, both for visitors and search engines as they can do or break the click frequency.
The question that arises is, how do you know if certain text is cut off in search results? I think document.designMode
Can fix it before pushing it live.
document.designMode
.With this tool, I think it would be much easier to see what different title lengths look like when they are truncated, whether the key words are immediately visible and how compelling it would be compared to other competitors on the same search result.
Develops workflows
In order to be completely honest, developers are likely to not use document.designMode
for actual development work. However, it can still be convenient for breaking things on a site, moving items around, repositioning images, deleting UI elements and undoing what was deleted, all in real time.
This can help if you are skeptical of the location of an element or feel that a button can do better at the top than at the bottom; document.designMode
Certainly could help. It definitely turns off the rearranging of items in the code base just to determine if an element located differently would look good. But again, most of the time we develop in a local environment where these things can be done just as effectively so that your mileage can vary as far as how useful you find document.designMode
in your development work.
Client and team collaboration
It is a no-brainer that some clients almost always have requests for changes at the last-minute thing as “Can we remove this button?” or “Let’s edit the price features at the free level.”
For the client, this is just small adjustments, but for you it can be a hassle to start your development environment to make these changes. I think document.designMode
Can help in such cases by making these changes in seconds without touching the production and sharing of screens with the client.
document.designMod
.It can also be useful in Team meetings when you discuss UI changes. Seeing real -time changes through screen sharing can help facilitate the discussion and lead to faster conclusions.
Live Dom -Tutorials
For beginners to learn web development I feel like document.designMode
can help give a first look at how it feels to manipulate a web page and immediately see the results – kind of similar A stage of development for webEven before you touch a code editor.
When students experiment with moving things around, an instructor can explain how each change works and affects the flow of the page.
Preview on social media content
We can use the same idea to view social media posts before we publish them! For example document.designMode
Can measure the effectiveness of different calls to action phrases or visualize what ad-copy looks like when users stumble over it as they roll through the platform. This would be effective on any social media platform.
document.designMode
.Memes
I didn’t think it would be fair not to add this. It seems to be out of place but let’s be honest: to create memes is probably one of the first things that come to mind when someone discovers document.designMode
.
You can create parody versions of social positions, fine -tune article headlines, change product prices, and manipulate YouTube views or Reddit comments, just to name a few of the ways you can feel things. Just remember: This should not be used to spread false information or cause actual damage. Keep it respectful and ethical!
Conclusion
document.designMode = "on"
is one of the lovely browser tricks that can be immediately useful when you discover it for the first time. It is a raw and primitive tool, but you cannot deny its utility and purpose.
So try it, show it to your colleagues or even edit this article. You never know when it might be exactly what you need.
Additional reading
(GG, YK)