Need help in making a Custom Javascript to Work

Posted in: Newspaper
Post count: 101

Hello Tagdiv,
I need a small help. I’m using a simple javascript to insert some content dynamically into an ID. If i want to insert some other content to some other ID, it is not working. It is working fine with the first line.

To make it clear. I have the javascript like this

`document.getElementById(‘massrdgfoot’).innerHTML = ‘Some Content’;
document.getElementByID(‘drbfoot’).innerHTML = ‘Some other Content’;

In this case, the content is included to the element with ID massrdgfoot. But not to the ID drbfoot.

Kindly help me with this, so that both of the IDs get their content dynamically.

Thanks

Post count: 9544

Does this work with default theme?

Not sure this is theme specific, but more WordPress specific ?

Post count: 22421

Hi Augustine,

This question is actually neither theme related nor WordPress related. It’s raw JS. This question is best posted on JS coding specific forums.
Off-topic: your syntax is different in your code.
document.getElementById != document.getElementByID (case sensitive Id and ID)
The correct syntax is this one: http://www.w3schools.com/jsref/met_doc_getelementbyid.asp

Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.