Simple way to get element by id within a div tag?

后端 未结 8 593
忘了有多久
忘了有多久 2020-12-04 19:44

Please forgive me if I repeat the question.

I have HTML that all elements inside a div tag has different id, suppose I have already get the reference to the div, is

8条回答
  •  天命终不由人
    2020-12-04 20:19

    Sample Html code   
     
    F1
    F2
    F3
    Type
    Javascript function getVal() { var test = document.getElementById("temp").getElementsByTagName("input"); alert("Number of Input Elements "+test.length); for(var i=0;i

提交回复
热议问题