In JQuery when trying to access elements, I see that if I have a form (lets say a textarea
), and I want to get the text
inside of it, I must use $("textarea").val();
Instead if I have a h1
element, I must use $("h")[0].innerHTML;
Why is this the case? h1.val()/textarea.innerHTML do not work
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…