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

What is a framework programming?

627


What is the difference between push() and concat() in javascript?

746


What are trailing whitespace?

638


Describe javascript and vbscript.

713


What is shift() method in javascript?

677


Does javascript support foreach loop?

692


Define closure.

668


What is the data type of variables in javascript?

635


How to use strings as array indexes using javascript?

709


How do I install javascript?

665


What is the most widely used programming language?

637


List out all the falsifying tokens in Javascript?

837


Is javascript default scripting language?

634


How can a Javascript code redirect the user to a different page?

695


What are javascript closures?when would you use them?

700