Can we create buttons in JavaScript ? if yes how? pls provide
sample code... Thanks in advance.....



Can we create buttons in JavaScript ? if yes how? pls provide sample code... Thanks in advance......

Answer / stardev24

We can create in multiple ways.Here I am doing by using jquery

HTML:
<div id="target">
<button id="CreateButton">Create button</button>
</div>

JAVASCRIPT:
$(document).ready(function () {
$("#CreateButton").click(
function () { $('#target').append('<button>button created</button>')
}
);
});

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More JavaScript Interview Questions

What is lazy instantiation in java?

0 Answers  


Do I need javascript enabled?

0 Answers  


List out all the falsifying tokens in Javascript?

0 Answers  


What is output of undefined * 2 in javascript?

0 Answers  


What are the new ways to define a variable in Javascript?

0 Answers  






Can any one tell me about s_objectID used for the anchor tag why it is used, what for and how to use it properly. with an example...please please......

1 Answers  


What is the use of window object?

0 Answers  


What is rest parameters in javascript?

0 Answers  


How to create a popup warning box?

0 Answers  


What does "1"+2+4 evaluate to?

10 Answers   Acheron, Satyam,


How to get the last index of a string in javascript?

0 Answers  


Iam getting xml when we click on one button.Iam placing that xml in dom.Im getting that xml data in one xsl.In that xsl I want to increase the variable value which is declared in xsl. Ex: <parent_node> <childNode> <first><d1>ffftt</d1></first> <first><d1>eeeeiii</d1></first> <first><d1>uuuuwww</d1></first> </childNode> <childNode> <first><d1>fff</d1></first> <first><d1>eeee</d1></first> <first><d1>uuuu</d1></first> </childNode> </parent_node>

0 Answers  


Categories