Sunday, April 2, 2017

Learn JavaScript VI (Object)

edankeun.com-we will learn about how to make Input and Output in HTML with JavaScript Object, here is an object that can be used to input in JavaScript


-Object Text
-Object Radio
-Object CheckBox

the object above can be used concurrently with other object or function in javascript
so in this tutorial we will explain it all one by one

1.Object Text
this object is used to make input text in html,such as input name,address, email address
here's is source code with explanation

** **


Create the function , is useful when you want add a button click

formedankeun= is use for tag form, <form name="formedankeun"> to show that html is refer to that form

textname= use when create tag html to input text *example <input type="text" name="textname">
you can change the name with everything

and the html should like this

inside the HTML tag you must place the name same with what you have created in javascript , if not same the JavaScript will not work

2.Object Radio
now about the object Radio, this object is used for choose the data just have a 2 possibility yes or not, true or false


to create object radio , you should use Radio <input type="Radio" name="yourNameVariable">

here's the sourcode
** **
don't forget to give the form name and must match with the variable Radio ,because it will direct the script to html

3.Object CheckBox

same like object radio but this object can be used if you want to create more choice of the data,
for example if you want create some choice to choose to set day for your alarm

here's is sample sourcode

** **

you just change the Input Type with Checkbox but you have to create the variable first and initialize with nill, because the variable will be filled when the checkbox checked

example


** **



Conclusion
the summary is if you want create some object in javascript you have to choose what input type,and also you can mix all the object and run concurrently and you can improve with conditional or looping


if you feel this article help you , please share and comment below :) thanks
see you in the next article


Related Posts

Learn JavaScript VI (Object)
4/ 5
Oleh

1 comments:

November 3, 2017 at 12:37 AM delete

Hello there. Thank you very much for your comment and support! It is such a pleasure to be visited by you! Keep learning from us! We hope we can educate people to learn coding more easily! Please contact us if you have a request :) Thank you so much... :D

Reply
avatar