computer
 






 

Question by  mick (11)

How do create a button using input element tags in Javascript?

 
+8

Answer by  Hampton (11)

The input element is actually HTML. The "type" attribute you want is button, so you would make it like so: input type="button" value="iAmAButton" onclick="javascriptFunction()" The "value" attribute is the text that will be on the button. The "onclick" attribute contains the name of the javascript function you want to execute when the button is clicked.

 
+6

Answer by  Christian9247 (5042)

This is a bit complicated but it involves HTML code like anything else. Use: Input element put type="button"value="iAmAButton" on click="javascriptFunction()" The attribute is the 'onlick' value is a Java script line that functions when you execute the button click. This will take the information entered in your information lines and enter them into a database.

 
+5

Answer by  mary3334 (85)

please replace all * into < and > symbol. document.write (" *html*"); document.write ( "*/body*"); document.write ( "*form name='f1' action='' method='post'*" ); document.write ( "*input type='text' name='tx1'*" ); document.write ( "*input type=button name='b1' value='Submit'*" ); document.write ( "*/form*" ); document.write ( "*/body*" ); document.write ( "*/html*" );

 
+5

Answer by  Assy (29)

Input element put type="button"value="iAmAButton" on click="javascriptFunction()" The value text attribute is the text will on be button and the "onclick" attribute contains name of javascript function the button is clicked.

 
+5

Answer by  karan0007 (53)

This element is actually actually HTML input input type="button" value="iAmAButton" onclick="javascriptFunction()"The "value" attribute is the text hat will be on the button. The "onclick" attribute contains the name of the javascript function you want to execute when the button is clicked. so thus we can create this button using input element.

 
+4

Answer by  worker6117 (32)

For browsers that support the innerHMTML property, just set "object. innerHTML = ' add a comment

 
+2

Answer by  japratt (1687)

In order to create the button on the Java script, you will need to have an element that can support it.

 
You have 50 words left!