Which of the following options is used to access a value inside a textbox that has "price" as id?
Select one:
a. document.getElementByNames("price")
b.document.getElementById("price")
c. document.getElementsByTagName("price")
d. document.getElementByName("price")
Answers
Answered by
1
dkdkfjdjdjfjfkdkdjfjfjekrjfjfjsj fb hg
Answered by
0
Answer:
option B) document.getElementById("price") is the correct answer
Explanation:
- The element with the supplied value is returned by the getElementById() function.
- If the element doesn't exist, the getElementById() function returns null.
- One of the most often used methods in the HTML DOM is getElementById(). It is utilised nearly often when reading or editing an HTML element.
Syntax
document.getElementById(elementID)
Parameter Description
id Required. The id value of an element.
Type Description
Object the element whose id is supplied.
if the element doesn't exist, null.
#SPJ3
Similar questions