***

form.myTextBox.value
document.getElementById("myTextBox");

Recommended Answers

All 2 Replies

hi
as per my view if in your page have a more than one form tag and have a same textbox name that time this is better way to use

form.myTextBox.value;

rather than this way.
b'cos it give you directly value from the current document

document.getElementById("myTextBox").value;

Thanks

Thank you. This clearly explains when to use what...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.