Wow to Use getElementById() in Javascript
RegisterLogin
Wow to Use getElementById() in Javascript
Post Description: This Page Will Teach You A With Some Example About Using Javascript Get Element By Id Function So You Can Get The Value Of An Element In A Form
Tags: Wow, To, Use, Getelementbyid(), In, Javascript
This Post Was Posted On Jan 10, 2010 By Webune Tutorials #3033
Post Description: This Page Will Teach You A With Some Example About Using Javascript Get Element By Id Function So You Can Get The Value Of An Element In A Form
Tags: Wow, To, Use, Getelementbyid(), In, Javascript
This Post Was Posted On Jan 10, 2010 By Webune Tutorials #3033
Wow to Use getElementById() in Javascript by Webune Tutorials
Welcome to Webune Forums.
Webune Offers Web Hosting for many sites.
One of the cool features about websites is the ability to use Javascript on your webpages.
if you are familiar programming in javascript or are new to javascript, perhaps you might find this short tutorial on about using javascript getElementById() function.
this is an example script you can use to see how you can get the value of a field using getElementById...
<script type="text/javascript" language="javascript">
function submitted(){
var form = document.myform2
for (i = 0; i < form.elements.length; i++) {
alert(document.getElementById(i).value);
}
}
</script>
Colors:
<form name="myform2">
first color: <input type="text" id="0" value="red"><br />
second color: <input type="text" id="1" value="blue"><br />
third color: <input type="text" id="2" value="green"><br /><br />
<input type="button" value="send" onclick="submitted();"/>
</form>Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Wed Dec 21, 2011 7:47 am
Powered by: Webune Forums V3
Powered by: Webune Forums V3