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
Where is javascript used most?
How generic objects can be created?
Can you access Cookie using javascript?
What is the difference between "var" and "let" keywords?
Explain function hoisting in javascript?
Which operator is used to assign a value to a variable?
What is differential inheritance?
How do you clear an array in javascript?
How onclick works in javascript?
How much do javascript programmers make?
What do you mean by script?
What is use of object as function?
How to get height and width of different browser in Javascript?
What is meant by vanilla javascript?
Can an anonymous function be assigned to a variable?