JSFiddle - React, Tailwind, and code Playground

by Yaroslav Ivanov

HTML

<!DOCTYPE html><html> <head><meta charset="utf-8" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /> <!--metatextblock--><title>test test Vakas</title><meta property="og:url" content="http://testv.tilda.ws/testvakas" /><meta property="og:title" content="test test Vakas" /><meta property="og:description" content="" /><meta property="og:type" content="website" /><meta property="og:image" content="https://static.tildacdn.com/tild3935-6563-4133-b536-316139323733/-/resize/504x/IMG_2414_.jpg" /><!--/metatextblock--><meta property="fb:app_id" content="257953674358265" /><meta name="format-detection" content="telephone=no" /><meta http-equiv="x-dns-prefetch-control" content="on"><link rel="dns-prefetch" href="https://tilda.ws"><link rel="dns-prefetch" href="https://static.tildacdn.com"><link rel="canonical" href="http://testv.tilda.ws/testvakas"><link rel="shortcut icon" href="https://static.tildacdn.com/img/tildafavicon.ico" type="image/x-icon" /><!-- Assets --><link rel="stylesheet" href="https://static.tildacdn.com/css/tilda-grid-3.0.min.css" type="text/css" media="all" /><link rel="stylesheet" href="https://tilda.ws/project1254969/tilda-blocks-2.12.css?t=1554475019" type="text/css" media="all" /><link rel="stylesheet" href="https://static.tildacdn.com/css/tilda-animation-1.0.min.css" type="text/css" media="all" /><link rel="stylesheet" href="https://static.tildacdn.com/css/tilda-slds-1.4.min.css" type="text/css" media="all" /><link rel="stylesheet" href="https://static.tildacdn.com/css/tilda-zoom-2.0.min.css" type="text/css" media="all" /><link rel="stylesheet" href="https://static.tildacdn.com/css/tilda-popup-1.1.min.css" type="text/css" media="all" /><script src="https://static.tildacdn.com/js/jquery-1.10.2.min.js"></script><script src="https://static.tildacdn.com/js/tilda-scripts-2.8.min.js"></script><script...

JavaScript

//document.body.innerHTML = document.body.innerHTML.replace(/{DATETIME}/g, '03 мая 15:00');

function replaceBreadCrumbs(label, text) {
	if(!document.body.innerText.includes(label)) return false;

	var elements = document.querySelectorAll("*");
  var elementWithLabel;
  
  for(var i = 0; i < elements.length; i++) {
  	if(elements[i].innerHTML.includes(label)) {
    	elementWithLabel = elements[i]
    }
  }
  
  elementWithLabel.innerHTML = elementWithLabel.innerHTML.replace(label, text);
  replaceBreadCrumbs.apply(null, arguments)
}

replaceBreadCrumbs("{DATETIME}", "03 мая 15:00");