Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

innerHTML for an element with id "demo" not returning

<meta name="viewport">

<script>

var today = new Date();
var date = today.getDate();
var text = "ఉదా: తేదీ " + date + " అయితే సామెతలు " + date + " నుంచి" ;

document.getElementById("demo").innerHTML = text ;

</script>

<h5 style="color:darkblue"> 2022 సంవత్సరం పూర్తి సిలబస్ </h5>

<p>ఒక సంవత్సరంలో బైబిల్ ను పూర్తిచేయు ప్రణాళిక<br>
సోమవారం నుంచి శనివారం వరకు 3 అధ్యాయాలు<br>
ఆదివారం 2 అధ్యాయాలు + జనరల్ ప్రశ్నలు</p>

<p> తేదీని బట్టి ప్రతిరోజు సామెతలు నుంచి 1 ప్రశ్న ఉంటుంది </p>

<p id="demo"></p>

<div style="margin: 0 auto"><iframe id="syllabus" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vReY-tDEwKYjTiSjsfAN42qjFUwMv_OD3_64bFdGrgL-2p3otc13elLcCq3pkb5xqhTA-bW3QXobpqh/pubhtml?gid=0&amp;single=true&amp;widget=false&amp;chrome=false&amp;headers=false&amp;range=a1:b366"></iframe></div>

Pls look my site https://sgquizdaily.com/2022-syllabus

I have wrote script for an element with id "demo"

But it’s not returning.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Any idea ?

Thank You

>Solution :

I think it is because you are loading the script before creting the element.
Try to put the script tag and code after declaring the <p id="demo"></p> element

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading