Open In App

How to Find and Replace Text in Web Pages?

Since the primary purpose of web pages was to be read, web browser vendors never saw the need to incorporate the “find and replace” capability. However, websites have developed and are now more than just static text blocks. Developers, content producers, and digital or social marketers can change the useful text on web pages quickly is essential in the digital world.

In this article, we will discuss various types of useful techniques and tools for Windows and macOS to Find and Replace Text on Web Pages.



How to Find and Replace Text in Web Pages?

Without employing browser extensions, the initial process is not possible to automatically change a word or content phrase within a web page to another. The mentioned methods and steps explain how to use the built-in Chrome Developer Tools, without the need for any external extensions, to search and alter text on web pages. This feature is essential for managing all the internal material on websites, keeping them updated, and improving user experience.

How to Find and Replace Text in Web Pages – For Windows

For Windows, users need to follow the below-mentioned steps to Find and Replace Text in Web Pages.



Step 1: Press Ctrl + Shift + J together > Open the internal Console Window inside the Chrome Developer tool.

Step 2: Follow the below command > Replace all the targeted or useful words like GEEKS with KEEGS

document.body.innerHTML = document.body.innerHTML.replace(/GEEKS/g, “KEEGS”)

Note: In Windows, users can use the system’s Regular Expressions for more substitutions and individuals. Also, to replace all the misspellings of occurrence, we can use

document.body.innerHTML.replace(/(ocurrance|occurrance|occurance)/g, 'occurrence');
document.body.innerHTML.replace(/oc[\w]+nce/g, 'occurrence');

How to Find and Replace Text in Web Pages – For MacOS

For Mac, users need to follow the below-mentioned steps to Find and Replace Text in Web Pages.

Step 1: Press Cmd + Opt + J together > Open the internal Console Window inside the Chrome Developer tool.

Step 2: Follow the below command > Replace all the targeted or useful words like EFG with MNO.

document.body.innerHTML = document.body.innerHTML.replace(/EFG/g, “MNO”)

Note: In MacOS, words within of a page can also be formatted using the initial method. The below-mentioned command, for example, will bold every incidence of the phrase “Geeks” on a page.

document.body.innerHTML.replace(/Hello/g, '<b>Geeks</b>');  

Conclusion

The internal capacity to locate and replace text on websites or servers with ease is an essential skill that gives users the power to successfully manage any digital content. Through the use of JavaScript solutions, extensions, and browser developer tools experience, people may confidently navigate the true world of text manipulation. Perfecting this kind of skill plays a major role in site development and content management systems in the digital era.

Also Read

How to Find and Replace Text in Web Pages – FAQs

How to find and replace any web browser properly?

Users need to follow some steps to find and replace any web browser properly:

  • Go to main page > Press Ctrl + Shift + F > Enter the required text.
  • Fill in the “Replace With” option > Click on “Refresh” or “Refresh all”

How to Find and Replace Text in HTML?

Follow below-mentioned steps to find and replace text in HTML:

  • Go and Click HTML Editor > Select Main menu.
  • Click on Edit > Select Find/Replace.

How to find and replace text in HTML?

Follow the below steps to find and replace text in HTML:

  • Select the text within HTML Editor pane to ensure it is within active pane.
  • Go to Main menu > Click Edit > Select Find/Replace.
Article Tags :