+ 1

What is the ID of an element in JavaScript??

Like in var ob=document.getElementbyId("text");

15th Apr 2017, 10:25 AM
Simran Jeet Singh
Simran Jeet Singh - avatar
3 Answers
+ 25
<p id=text>Text</p> document.getElementById("text") (based on what id the developer gives it...)
15th Apr 2017, 10:27 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 23
anything
15th Apr 2017, 10:37 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 2
The 'Text' in paragraph body can be anything or is it supposed to be 'Text' only ?? @ValentinHacker
15th Apr 2017, 10:34 AM
Simran Jeet Singh
Simran Jeet Singh - avatar