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

Methods get and post in html forms - what's the difference?

0 Answers  


What are the two basic groups of dataypes in javascript?

0 Answers  


What is the use of a form in html page? Is there any way to submit the page without using the form.

3 Answers   Kanbay, TCS,


List few difference between primitive and non primitive javascript data types?

0 Answers  


What is the === in javascript?

0 Answers  






What are the security related issues in JavaScript scripts?

3 Answers   Four soft,


What is webassembly good for?

0 Answers  


Where do I write javascript code?

0 Answers  


How to write hello world on the web page?

0 Answers  


How many types of functions JavaScript supports?

0 Answers  


How about 2+5+"8"?

6 Answers   Satyam,


What is rest parameters in javascript?

0 Answers  


Categories