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 are parameters in javascript?

0 Answers  


Is it possible to do 301 redirects in javascript ?

0 Answers  


How to capture the Image width and height using QTP script ? Kindly answer plz.... Thanx in adavance...

0 Answers  


What is the difference between rootscope and scope?

0 Answers  


Define anonymous function.

0 Answers  


What are nodes in javascript?

0 Answers  


What is number in javascript?

0 Answers  


what is syntax of wapper class

1 Answers  


what is the extension of java script.

1 Answers  


Is javascript case sensitive language?

0 Answers  


print the following using loop. 54321 4321 321 21 1

2 Answers   Delhi Public School,


How to reload the current page?

0 Answers  


Categories