+ 1
color work on firefox but not work on chrome
i change color specific character by this regex. it work on firefox but not work on chrome? why? let n = n.replace(/(\u064D)/g, "<span class='redcolor'>$1</span>"); document.getElementById("divmain").innerHTML = n; css: .redcolor { color: red; }
2 Respuestas
+ 5
Also it is possible that the problem is caused by how your code (particularly the JS) is organized. Maybe the chrome tries running the javascript when the html dom structure is not yet created. You can try binding the JS to the window.onload or document.onload event. It would be easier to analyse, seeing your complete code.
+ 3
See if there's a hint or tip here:
https://www.sololearn.com/discuss/2922954/?ref=app
https://www.sololearn.com/discuss/237161/?ref=app
https://www.sololearn.com/discuss/200697/?ref=app