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

How to get the primitive value of a string in Javascript?

0 Answers  


What is spread operator?

0 Answers  


How to remove duplicate values from a javascript array?

0 Answers  


Name the different types of pop up boxes in Javascript?

0 Answers  


How to write normal text code using JavaScript dynamically?

0 Answers  






How to make a array as a stack using javascript?

0 Answers  


What is a reverse string?

0 Answers  


Name some of the Javascript frameworks?

0 Answers  


what is a dataset

0 Answers   Omax,


what is lazy fetching in hibernate

0 Answers   iGate, Infosys,


What would be the result of 3+2+”7″?

0 Answers  


How do you write a comment in javascript?

0 Answers  


Categories