JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" placeholder="Put text in me!" id="input" value="4" />
<input type="button" onclick="getBinary()" value="Check Binary" />
<p id="result"></p>
<p id="binary"></p>
JavaScript
a=function(n){b="";for(var t=0;t<n.length;t++)c=[n.charCodeAt(t).toString(2)],c.unshift(Array(8-c[0].length+1).join(0)),b+=c.join("");return b.match(/[1]{4,}|[0]{4,}/g)?!1:!0}
getBinary = function(string){
document.getElementById("result").innerHTML = a(document.getElementById("input").value)
}