Skip to content
Advertisement

Javascript code not running on some webpages [closed]

Am new to javascript. Am trying to display errors in my project webpages in the form of span. So i used javascript code to input a certain text into the span through its id as the following:

JavaScript

The id is linked to the following HTML span:

JavaScript

And then i run the javascript code inside HTML in the <script> tag as follows:

JavaScript

That method worked fine in other two webpages same way but in this one it doesn’t. Also the code works fine as i tested the code using PHP echo and it output same string.

Advertisement

Answer

It seems the answer was not use javascript as i did at all, e.g.:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement