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 setting a cookie with the contents of a textbox?

0 Answers  


What is the difference between undefined value and null value?

0 Answers  


Is javascript pure object oriented?

0 Answers  


Write the code to maximize an image using javaScript?

2 Answers   Infosys,


Is javascript whitespace sensitive?

0 Answers  






List the comparison operators supported by javascript?

0 Answers  


How can a particular frame be targeted, from a hyperlink, in javascript?

0 Answers  


Define unescape() and escape() functions?

0 Answers  


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

0 Answers  


List some of the disadvantages of javascript.

1 Answers  


print the following using loop. 54321 4321 321 21 1

2 Answers   Delhi Public School,


How do I unblock javascript in chrome?

0 Answers  


Categories