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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a way by which you can do something on the close of the window ?

572


Is javascript array dynamic?

495


What is javascript and its advantages?

549


What is innertext javascript?

479


What is the difference between test () and exec () methods?

627






Which built-in method returns the calling string value converted to lower case?

723


What are the features of javascript?

490


What are the problems associated with using javascript, and are there javascript techniques that you discourage?

614


Describe the properties of an anonymous function in JavaScript?

720


What is the disadvantage of javascript?

470


Which company developed JavaScript?

597


What is jscript used for?

479


What does break and continue statements do in javascript?

531


Why is currying called currying?

473


What is event target in javascript?

479